Source-Changes-HG archive

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

[src/trunk]: src/sys/kern provide more info about who is getting ERESTART.



details:   https://anonhg.NetBSD.org/src/rev/6b65d5ff70f4
branches:  trunk
changeset: 999147:6b65d5ff70f4
user:      christos <christos%NetBSD.org@localhost>
date:      Tue May 21 18:09:31 2019 +0000

description:
provide more info about who is getting ERESTART.

diffstat:

 sys/kern/sys_descrip.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r f6d264a74913 -r 6b65d5ff70f4 sys/kern/sys_descrip.c
--- a/sys/kern/sys_descrip.c    Tue May 21 16:56:10 2019 +0000
+++ b/sys/kern/sys_descrip.c    Tue May 21 18:09:31 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_descrip.c,v 1.32 2019/02/03 03:19:28 mrg Exp $     */
+/*     $NetBSD: sys_descrip.c,v 1.33 2019/05/21 18:09:31 christos Exp $        */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.32 2019/02/03 03:19:28 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.33 2019/05/21 18:09:31 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -481,16 +481,17 @@
                syscallarg(int) fd;
        } */
        int error;
+       int fd = SCARG(uap, fd);
 
-       if (fd_getfile(SCARG(uap, fd)) == NULL) {
+       if (fd_getfile(fd) == NULL) {
                return EBADF;
        }
 
-       error = fd_close(SCARG(uap, fd));
+       error = fd_close(fd);
        if (error == ERESTART) {
 #ifdef DIAGNOSTIC
-               printf("pid %d: close returned ERESTART\n",
-                   (int)l->l_proc->p_pid);
+               printf("%s[%d]: close(%d) returned ERESTART\n",
+                   l->l_proc->p_comm, (int)l->l_proc->p_pid, fd);
 #endif
                error = EINTR;
        }



Home | Main Index | Thread Index | Old Index