Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpuser * if kevent() fails with EINTR, try again in...



details:   https://anonhg.NetBSD.org/src/rev/822b9a7862a6
branches:  trunk
changeset: 757022:822b9a7862a6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Aug 11 10:25:59 2010 +0000

description:
* if kevent() fails with EINTR, try again instead of returning an error
* stuff rumpuser_dprintf to stderr instead of stdout

diffstat:

 lib/librumpuser/rumpuser.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 113afbdfc74b -r 822b9a7862a6 lib/librumpuser/rumpuser.c
--- a/lib/librumpuser/rumpuser.c        Wed Aug 11 09:36:44 2010 +0000
+++ b/lib/librumpuser/rumpuser.c        Wed Aug 11 10:25:59 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser.c,v 1.8 2010/06/09 14:08:17 pooka Exp $       */
+/*     $NetBSD: rumpuser.c,v 1.9 2010/08/11 10:25:59 pooka Exp $       */
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.8 2010/06/09 14:08:17 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.9 2010/08/11 10:25:59 pooka Exp $");
 #endif /* !lint */
 
 /* thank the maker for this */
@@ -556,8 +556,11 @@
        struct kevent kev;
        int rv;
 
+ again:
        KLOCK_WRAP(rv = kevent(kq, NULL, 0, &kev, 1, NULL));
        if (rv == -1) {
+               if (errno == EINTR)
+                       goto again;
                *error = errno;
                return -1;
        }
@@ -577,7 +580,7 @@
        int rv;
 
        va_start(ap, format);
-       rv = vprintf(format, ap);
+       rv = vfprintf(stderr, format, ap);
        va_end(ap);
 
        return rv;



Home | Main Index | Thread Index | Old Index