diff options
author | jonathan <jonathan@FreeBSD.org> | 2011-07-08 12:16:30 +0000 |
---|---|---|
committer | jonathan <jonathan@FreeBSD.org> | 2011-07-08 12:16:30 +0000 |
commit | f07a2b912b2fbaa99bfe57e02f3d2c72ce60ff81 (patch) | |
tree | fa59cde14529d32b89e630b31c40332129f5a74c /tools/regression/kqueue/proc.c | |
parent | c50de82aab4efc1aae6002a965cbd56ee7928d9d (diff) | |
download | FreeBSD-src-f07a2b912b2fbaa99bfe57e02f3d2c72ce60ff81.zip FreeBSD-src-f07a2b912b2fbaa99bfe57e02f3d2c72ce60ff81.tar.gz |
Clarify the meaning of a test.
Rather than using err() if either of two failure conditions
fires (which can produce spurious error messages), just use
errx() if the one condition that really matters fires.
In practice, this single test is enough to detect the failure
mode we're looking for (kqueue being inherited across fork).
Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
Diffstat (limited to 'tools/regression/kqueue/proc.c')
-rw-r--r-- | tools/regression/kqueue/proc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/regression/kqueue/proc.c b/tools/regression/kqueue/proc.c index 2835c64..6288ee6 100644 --- a/tools/regression/kqueue/proc.c +++ b/tools/regression/kqueue/proc.c @@ -43,9 +43,9 @@ add_and_delete(void) pid = fork(); if (pid == 0) { struct stat s; - if ((fstat(kqfd, &s) != -1) || (errno != EBADF)) - err(1, "%s:%d - %s: fstat(kqfd) in child did not return EBADF", - __FILE__, __LINE__, __func__); + if (fstat(kqfd, &s) != -1) + errx(1, "kqueue inherited across fork! (%s() at %s:%d)", + __func__, __FILE__, __LINE__); pause(); exit(2); |