Source-Changes-HG archive

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

[src/trunk]: src/tests/kernel Replace printf() in child process with a simple...



details:   https://anonhg.NetBSD.org/src/rev/17021bf3ce14
branches:  trunk
changeset: 785052:17021bf3ce14
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Feb 19 22:44:27 2013 +0000

description:
Replace printf() in child process with a simple write(STDERR_FILNO,...)

Thanks, Joerg.

diffstat:

 tests/kernel/t_lockf.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r c15010d32404 -r 17021bf3ce14 tests/kernel/t_lockf.c
--- a/tests/kernel/t_lockf.c    Tue Feb 19 21:16:26 2013 +0000
+++ b/tests/kernel/t_lockf.c    Tue Feb 19 22:44:27 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_lockf.c,v 1.6 2013/02/19 04:58:40 pgoyette Exp $     */
+/*     $NetBSD: t_lockf.c,v 1.7 2013/02/19 22:44:27 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -123,6 +123,7 @@
        pid_t *pid;
        int status;
        char pipe_in, pipe_out;
+       const char *pipe_errmsg = "child: pipe write failed\n";
 
        (void)unlink(lockfile);
 
@@ -145,8 +146,8 @@
                switch (pid[i]) {
                case 0:
                        if (write(pipe_fd[1], &pipe_out, 1) != 1)
-                               printf("write_pipe(%i): %s", i,
-                               strerror(errno));
+                               write(STDERR_FILENO, pipe_errmsg,
+                                   __arraycount(pipe_errmsg));
                        else
                                trylocks(i);
                        _exit(0);



Home | Main Index | Thread Index | Old Index