diff options
author | Niels Provos <provos@cvs.openbsd.org> | 2002-06-04 19:25:55 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 2002-06-04 19:25:55 +0000 |
commit | 1182df00f0a31834b42e85599fa3604e5aa51cb6 (patch) | |
tree | d891d91bcb58d4b110f5372a3f25b12d09a65d65 /bin | |
parent | 62db746253bff150f34fab0644ecda488752ed45 (diff) |
complain about missing device only once. from deraadt@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/systrace/intercept.c | 6 | ||||
-rw-r--r-- | bin/systrace/systrace.c | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/bin/systrace/intercept.c b/bin/systrace/intercept.c index 5d3903bc5c6..a7bada57d23 100644 --- a/bin/systrace/intercept.c +++ b/bin/systrace/intercept.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intercept.c,v 1.3 2002/06/04 19:15:54 deraadt Exp $ */ +/* $OpenBSD: intercept.c,v 1.4 2002/06/04 19:25:54 provos Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -288,7 +288,9 @@ intercept_open(void) { int fd; - fd = intercept.open(); + if ((fd = intercept.open()) == -1) + return (-1); + if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) warn("fcntl(O_NONBLOCK)"); diff --git a/bin/systrace/systrace.c b/bin/systrace/systrace.c index 01a3aaadcba..51433fca8bc 100644 --- a/bin/systrace/systrace.c +++ b/bin/systrace/systrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: systrace.c,v 1.3 2002/06/04 19:15:54 deraadt Exp $ */ +/* $OpenBSD: systrace.c,v 1.4 2002/06/04 19:25:54 provos Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -423,7 +423,8 @@ main(int argc, char **argv) systrace_initpolicy(filename); systrace_initcb(); - X(fd = intercept_open()); + if ((fd = intercept_open()) == -1) + exit(1); pid = intercept_run(fd, args[0], args); if (pid == -1) |