aboutsummaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-03-19 18:00:58 +0100
committerPetr Machata <pmachata@redhat.com>2013-03-19 18:09:04 +0100
commit8be68ff436d32e803907e6dda3dc994c495d2f1e (patch)
tree06a855ca17c7865f45cf45b18f5a9f844a767384 /proc.c
parentf70812ec281a829ca7a758337aacec58eca41550 (diff)
downloadltrace-8be68ff436d32e803907e6dda3dc994c495d2f1e.tar.gz
open_one_pid doesn't return boolean, but <0 on error
- This compiles down to the exact same code, but we want to be clear about the calling convention.
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index aab0b62..add999e 100644
--- a/proc.c
+++ b/proc.c
@@ -518,7 +518,7 @@ open_pid(pid_t pid)
return;
/* First, see if we can attach the requested PID itself. */
- if (open_one_pid(pid)) {
+ if (open_one_pid(pid) < 0) {
fprintf(stderr, "Cannot attach to pid %u: %s\n",
pid, strerror(errno));
trace_fail_warning(pid);
@@ -550,7 +550,7 @@ open_pid(pid_t pid)
have_all = 1;
for (i = 0; i < ntasks; ++i)
if (pid2proc(tasks[i]) == NULL
- && open_one_pid(tasks[i]))
+ && open_one_pid(tasks[i]) < 0)
have_all = 0;
free(tasks);