Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/common wrap system() in SIG_DFL so that child-beari...



details:   https://anonhg.NetBSD.org/src/rev/a5b91410e0e2
branches:  trunk
changeset: 760809:a5b91410e0e2
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Jan 13 12:55:19 2011 +0000

description:
wrap system() in SIG_DFL so that child-bearing fs tests (puffs,
nfs) don't go cuckoo when the process executed by system() takes a
backstage left.

diffstat:

 tests/fs/common/fstest_ffs.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 7ed6a0797e99 -r a5b91410e0e2 tests/fs/common/fstest_ffs.c
--- a/tests/fs/common/fstest_ffs.c      Thu Jan 13 11:57:02 2011 +0000
+++ b/tests/fs/common/fstest_ffs.c      Thu Jan 13 12:55:19 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fstest_ffs.c,v 1.3 2011/01/07 11:52:59 pooka Exp $     */
+/*     $NetBSD: fstest_ffs.c,v 1.4 2011/01/13 12:55:19 pooka Exp $     */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -59,10 +59,15 @@
        int res;
        static unsigned int num = 0;
        struct ffstestargs *args;
+       struct sigaction act, oact;
 
        size /= 512;
        snprintf(cmd, 1024, "newfs -F -s %"PRId64" %s >/dev/null", size, image);
+       memset(&act, 0, sizeof(act));
+       act.sa_handler = SIG_DFL;
+       sigaction(SIGCHLD, &act, &oact);
        res = system(cmd);
+       sigaction(SIGCHLD, &oact, NULL);
        if (res != 0)
                return res;
 



Home | Main Index | Thread Index | Old Index