Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/filemon Fix return-code handling for execve and chdi...



details:   https://anonhg.NetBSD.org/src/rev/fe2dc07b5ebf
branches:  trunk
changeset: 341773:fe2dc07b5ebf
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Nov 22 01:20:52 2015 +0000

description:
Fix return-code handling for execve and chdir wrappers.

Fixes PR kern/50309

diffstat:

 sys/dev/filemon/filemon_wrapper.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (50 lines):

diff -r e1d7a6523d49 -r fe2dc07b5ebf sys/dev/filemon/filemon_wrapper.c
--- a/sys/dev/filemon/filemon_wrapper.c Sun Nov 22 01:20:36 2015 +0000
+++ b/sys/dev/filemon/filemon_wrapper.c Sun Nov 22 01:20:52 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filemon_wrapper.c,v 1.8 2015/11/20 01:16:04 pgoyette Exp $     */
+/*     $NetBSD: filemon_wrapper.c,v 1.9 2015/11/22 01:20:52 pgoyette Exp $     */
 
 /*
  * Copyright (c) 2010, Juniper Networks, Inc.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filemon_wrapper.c,v 1.8 2015/11/20 01:16:04 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filemon_wrapper.c,v 1.9 2015/11/22 01:20:52 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -48,7 +48,7 @@
        struct filemon *filemon;
        
        if ((error = sys_chdir(l, uap, retval)) != 0)
-               return 0;
+               return error;
 
        filemon = filemon_lookup(curproc);
        if (filemon == NULL)
@@ -76,11 +76,11 @@
        struct filemon *filemon;
        
        if ((error = sys_execve(l, uap, retval)) != EJUSTRETURN)
-               return 0;
+               return error;
 
        filemon = filemon_lookup(curproc);
        if (filemon == NULL)
-               return 0;
+               return EJUSTRETURN;
 
        error = copyinstr(SCARG(uap, path), fname, sizeof(fname), &done);
        if (error)
@@ -89,7 +89,7 @@
        filemon_printf(filemon, "E %d %s\n", curproc->p_pid, fname);
 out:
        rw_exit(&filemon->fm_mtx);
-       return 0;
+       return EJUSTRETURN;
 }
 
 



Home | Main Index | Thread Index | Old Index