Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b5ec91a5
Commit
b5ec91a5
authored
Dec 05, 2008
by
Eli Zaretskii
Browse files
(procfs_system_process_attributes): If `nread' has a negative value, assign
zero to it.
parent
b3f1f4a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
src/ChangeLog
src/ChangeLog
+5
-0
src/process.c
src/process.c
+9
-1
No files found.
src/ChangeLog
View file @
b5ec91a5
2008-12-05 Eli Zaretskii <eliz@gnu.org>
* process.c (procfs_system_process_attributes): If `nread' has a
negative value, assign zero to it.
2008-12-05 Chong Yidong <cyd@stupidchicken.com>
* eval.c (Vdebug_on_error): Doc fix.
...
...
src/process.c
View file @
b5ec91a5
...
...
@@ -7434,6 +7434,14 @@ procfs_system_process_attributes (pid)
cmdline[0] = '\0';
if ((nread = read (fd, cmdline, cmdline_size)) >= 0)
cmdline[nread++] = '\0';
else
{
/* Assigning zero to `nread' makes us skip the following
two loops, assign zero to cmdline_size, and enter the
following `if' clause that handles unknown command
lines. */
nread = 0;
}
/* We don't want trailing null characters. */
for (p = cmdline + nread - 1; p > cmdline && !*p; p--)
nread--;
...
...
@@ -7451,7 +7459,7 @@ procfs_system_process_attributes (pid)
}
cmdline_size = nread;
}
else
if (!cmdline_size)
{
if (!cmd)
cmd = "???";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment