Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpuser make implementation of rumpuser_kill() match...



details:   https://anonhg.NetBSD.org/src/rev/d21e46a9dcc5
branches:  trunk
changeset: 793575:d21e46a9dcc5
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Feb 20 00:44:20 2014 +0000

description:
make implementation of rumpuser_kill() match the documentation

diffstat:

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

diffs (44 lines):

diff -r a68bd4255b85 -r d21e46a9dcc5 lib/librumpuser/rumpuser.c
--- a/lib/librumpuser/rumpuser.c        Thu Feb 20 00:43:26 2014 +0000
+++ b/lib/librumpuser/rumpuser.c        Thu Feb 20 00:44:20 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser.c,v 1.56 2014/02/20 00:42:27 pooka Exp $      */
+/*     $NetBSD: rumpuser.c,v 1.57 2014/02/20 00:44:20 pooka Exp $      */
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #include "rumpuser_port.h"
 
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.56 2014/02/20 00:42:27 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.57 2014/02/20 00:44:20 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/ioctl.h>
@@ -645,21 +645,12 @@
 int
 rumpuser_kill(int64_t pid, int rumpsig)
 {
-       int rv, sig;
-       int error;
+       int sig;
 
        sig = rumpuser__sig_rump2host(rumpsig);
-       if (pid == RUMPUSER_PID_SELF) {
-               error = raise(sig);
-       } else {
-               error = kill((pid_t)pid, sig);
-       }
-       if (error == -1)
-               rv = errno;
-       else
-               rv = 0;
-
-       ET(rv);
+       if (sig > 0)
+               raise(sig);
+       return 0;
 }
 
 int



Home | Main Index | Thread Index | Old Index