Date: Fri, 8 Jul 2011 12:16:31 +0000 (UTC) From: Jonathan Anderson <jonathan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r223865 - head/tools/regression/kqueue Message-ID: <201107081216.p68CGVtZ017242@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jonathan Date: Fri Jul 8 12:16:30 2011 New Revision: 223865 URL: http://svn.freebsd.org/changeset/base/223865 Log: 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 Modified: head/tools/regression/kqueue/config.h head/tools/regression/kqueue/proc.c Modified: head/tools/regression/kqueue/config.h ============================================================================== --- head/tools/regression/kqueue/config.h Fri Jul 8 10:58:56 2011 (r223864) +++ head/tools/regression/kqueue/config.h Fri Jul 8 12:16:30 2011 (r223865) @@ -1,4 +1,4 @@ -# $FreeBSD$ +/* $FreeBSD$ */ #define HAVE_ERR_H 1 #define HAVE_SYS_EVENT_H 1 Modified: head/tools/regression/kqueue/proc.c ============================================================================== --- head/tools/regression/kqueue/proc.c Fri Jul 8 10:58:56 2011 (r223864) +++ head/tools/regression/kqueue/proc.c Fri Jul 8 12:16:30 2011 (r223865) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107081216.p68CGVtZ017242>