From 04a469212b4c9e49573dc4e92c603518d5c12539 Mon Sep 17 00:00:00 2001 From: provos Date: Thu, 17 Oct 2002 04:45:04 +0000 Subject: [PATCH] cleanup --- bin/systrace/intercept.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bin/systrace/intercept.c b/bin/systrace/intercept.c index c8a15d33a829..c00e8ae002ab 100644 --- a/bin/systrace/intercept.c +++ b/bin/systrace/intercept.c @@ -1,4 +1,4 @@ -/* $NetBSD: intercept.c,v 1.8 2002/10/11 21:54:57 provos Exp $ */ +/* $NetBSD: intercept.c,v 1.9 2002/10/17 04:45:04 provos Exp $ */ /* $OpenBSD: intercept.c,v 1.29 2002/08/28 03:30:27 itojun Exp $ */ /* * Copyright 2002 Niels Provos @@ -30,7 +30,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: intercept.c,v 1.8 2002/10/11 21:54:57 provos Exp $"); +__RCSID("$NetBSD: intercept.c,v 1.9 2002/10/17 04:45:04 provos Exp $"); #include #include @@ -331,8 +331,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) { @@ -439,8 +438,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"); @@ -582,8 +580,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");