From 260412feaea2f12bd4879b39693ca8656d4ca818 Mon Sep 17 00:00:00 2001 From: pgoyette Date: Sun, 22 Nov 2015 01:20:52 +0000 Subject: Fix return-code handling for execve and chdir wrappers. Fixes PR kern/50309 --- sys/dev/filemon/filemon_wrapper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/filemon/filemon_wrapper.c b/sys/dev/filemon/filemon_wrapper.c index 1e2b73cc5db..e526ea45047 100644 --- a/sys/dev/filemon/filemon_wrapper.c +++ b/sys/dev/filemon/filemon_wrapper.c @@ -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 -__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 #include @@ -48,7 +48,7 @@ filemon_wrapper_chdir(struct lwp * l, const struct sys_chdir_args * uap, 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 @@ filemon_wrapper_execve(struct lwp * l, struct sys_execve_args * uap, 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_wrapper_execve(struct lwp * l, struct sys_execve_args * uap, filemon_printf(filemon, "E %d %s\n", curproc->p_pid, fname); out: rw_exit(&filemon->fm_mtx); - return 0; + return EJUSTRETURN; } -- cgit