summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-10-17 05:49:41 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-10-17 05:49:41 +0000
commit5419449a102c5873ce95c591509275ff4c2cfa31 (patch)
tree24322f61563b9418e405498ebe23240d706bfe49
parenta527a0875f18044cf2c97230f575ed636c44cac4 (diff)
little cleanup (intercept_getpid dies within the function on error).
from provos
-rw-r--r--bin/systrace/intercept.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/systrace/intercept.c b/bin/systrace/intercept.c
index 34070400b67..3328e3b8689 100644
--- a/bin/systrace/intercept.c
+++ b/bin/systrace/intercept.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intercept.c,v 1.33 2002/10/16 15:01:08 itojun Exp $ */
+/* $OpenBSD: intercept.c,v 1.34 2002/10/17 05:49:40 itojun Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -328,8 +328,7 @@ intercept_run(int bg, int fd, uid_t uid, gid_t gid,
/* Choose the pid of the systraced process */
pid = bg ? pid : cpid;
- if ((icpid = intercept_getpid(pid)) == NULL)
- err(1, "intercept_getpid");
+ icpid = intercept_getpid(pid);
/* Set up user related information */
if (!uid && !gid) {
@@ -436,8 +435,7 @@ intercept_attachpid(int fd, pid_t pid, char *name)
if (res == -1)
return (-1);
- if ((icpid = intercept_getpid(pid)) == NULL)
- return (-1);
+ icpid = intercept_getpid(pid);
if ((icpid->newname = strdup(name)) == NULL)
err(1, "strdup");
@@ -579,8 +577,7 @@ intercept_filename(int fd, pid_t pid, void *addr, int userp)
}
/* Update cwd for process */
- if ((icpid = intercept_getpid(pid)) == NULL)
- err(1, "intercept_getpid");
+ icpid = intercept_getpid(pid);
if (strlcpy(icpid->cwd, cwd, sizeof(icpid->cwd)) >= sizeof(icpid->cwd))
errx(1, "cwd too long");