Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpclient Ignore failed closes (if for example a clo...



details:   https://anonhg.NetBSD.org/src/rev/8acd753a886c
branches:  trunk
changeset: 1023500:8acd753a886c
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 11 14:23:04 2021 +0000

description:
Ignore failed closes (if for example a closed file descriptor is passed as
a starting point). This is how the kernel behaves.

diffstat:

 lib/librumpclient/rumpclient.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 298002678d7d -r 8acd753a886c lib/librumpclient/rumpclient.c
--- a/lib/librumpclient/rumpclient.c    Sat Sep 11 14:22:12 2021 +0000
+++ b/lib/librumpclient/rumpclient.c    Sat Sep 11 14:23:04 2021 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpclient.c,v 1.67 2016/09/06 07:45:41 martin Exp $  */
+/*      $NetBSD: rumpclient.c,v 1.68 2021/09/11 14:23:04 christos Exp $        */
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -50,7 +50,7 @@
 #define USE_SIGNALFD
 #endif
 
-__RCSID("$NetBSD: rumpclient.c,v 1.67 2016/09/06 07:45:41 martin Exp $");
+__RCSID("$NetBSD: rumpclient.c,v 1.68 2021/09/11 14:23:04 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/mman.h>
@@ -1087,7 +1087,7 @@
 rumpclient__closenotify(int *fdp, enum rumpclient_closevariant variant)
 {
        int fd = *fdp;
-       int untilfd, rv;
+       int untilfd;
        int newfd;
 
        switch (variant) {
@@ -1096,9 +1096,7 @@
                for (; fd <= untilfd; fd++) {
                        if (fd == clispc.spc_fd || fd == holyfd)
                                continue;
-                       rv = host_close(fd);
-                       if (rv == -1)
-                               return -1;
+                       (void)host_close(fd);
                }
                *fdp = fd;
                break;



Home | Main Index | Thread Index | Old Index