summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-07-30 05:52:51 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-07-30 05:52:51 +0000
commit5dc9a4629777a9197eecc4d8ba27065036be263c (patch)
tree16c0f6fa82afe2b7d12605e2dd42cbe81e91cffb /bin
parentc1773af84c6c752eb4af2d015cc80e7085fb256c (diff)
SPLAY_INSERT is a void function
Diffstat (limited to 'bin')
-rw-r--r--bin/systrace/alias.c9
-rw-r--r--bin/systrace/systrace.c24
2 files changed, 15 insertions, 18 deletions
diff --git a/bin/systrace/alias.c b/bin/systrace/alias.c
index 3ef6439d2eb..5821cb64fe3 100644
--- a/bin/systrace/alias.c
+++ b/bin/systrace/alias.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alias.c,v 1.2 2002/07/19 14:38:57 itojun Exp $ */
+/* $OpenBSD: alias.c,v 1.3 2002/07/30 05:52:50 itojun Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -132,9 +132,7 @@ systrace_reverse(const char *emulation, const char *name)
TAILQ_INIT(&reverse->revl);
- if (SPLAY_INSERT(revtr, &revroot, reverse) != NULL)
- errx(1, "%s: %s-%s: double revalias",
- __func__, emulation, name);
+ SPLAY_INSERT(revtr, &revroot, reverse);
return (reverse);
}
@@ -156,8 +154,7 @@ systrace_new_alias(const char *emulation, const char *name,
strlcpy(alias->aname, aname, sizeof(alias->aname));
alias->nargs = 0;
- if (SPLAY_INSERT(alitr, &aliasroot, alias) != NULL)
- errx(1, "%s: %s-%s: double alias", __func__, emulation, name);
+ SPLAY_INSERT(alitr, &aliasroot, alias);
reverse = systrace_reverse(aemul, aname);
alias->reverse = reverse;
diff --git a/bin/systrace/systrace.c b/bin/systrace/systrace.c
index c5c5d196104..e85a1693ae5 100644
--- a/bin/systrace/systrace.c
+++ b/bin/systrace/systrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: systrace.c,v 1.29 2002/07/19 14:38:58 itojun Exp $ */
+/* $OpenBSD: systrace.c,v 1.30 2002/07/30 05:52:50 itojun Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -49,8 +49,8 @@
#include "systrace.h"
#include "util.h"
-pid_t pid;
-int fd;
+pid_t trpid;
+int trfd;
int connected = 0; /* Connected to GUI */
int inherit = 0; /* Inherit policy to childs */
int automatic = 0; /* Do not run interactively */
@@ -318,7 +318,7 @@ child_handler(int sig)
int s = errno, status;
if (signal(SIGCHLD, child_handler) == SIG_ERR) {
- close(fd);
+ close(trfd);
}
while (wait4(-1, &status, WNOHANG, NULL) > 0)
@@ -448,7 +448,7 @@ main(int argc, char **argv)
systrace_initpolicy(filename);
systrace_initcb();
- if ((fd = intercept_open()) == -1)
+ if ((trfd = intercept_open()) == -1)
exit(1);
/* See if we can run the systrace process in the background */
@@ -463,18 +463,18 @@ main(int argc, char **argv)
args[i] = argv[i];
args[i] = NULL;
- pid = intercept_run(background, fd, args[0], args);
- if (pid == -1)
+ trpid = intercept_run(background, trfd, args[0], args);
+ if (trpid == -1)
err(1, "fork");
- if (intercept_attach(fd, pid) == -1)
+ if (intercept_attach(trfd, trpid) == -1)
err(1, "attach");
- if (kill(pid, SIGUSR1) == -1)
+ if (kill(trpid, SIGUSR1) == -1)
err(1, "kill");
} else {
/* Attach to a running command */
- if (intercept_attachpid(fd, pidattach, argv[0]) == -1)
+ if (intercept_attachpid(trfd, pidattach, argv[0]) == -1)
err(1, "attachpid");
if (background) {
@@ -490,14 +490,14 @@ main(int argc, char **argv)
if (usex11 && !automatic && !allow)
requestor_start(guipath);
- while (intercept_read(fd) != -1)
+ while (intercept_read(trfd) != -1)
if (!intercept_existpids())
break;
if (userpolicy)
systrace_dumppolicy();
- close(fd);
+ close(trfd);
exit(0);
}