Fix __sysctl() to return the proper value to the caller, to match
documented behavior. sysctl(3) is documented to return 0 on success, -1 on failure. The previous behavior was to return -1 on failure and the number of bytes copied back down to user space. Fixes part of PR #1999, from Kevin M. Lahey <kml@nas.nasa.gov>
This commit is contained in:
parent
bc56857b49
commit
e408d7413a
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_sysctl.c,v 1.15 1996/02/27 04:20:40 jonathan Exp $ */
|
||||
/* $NetBSD: kern_sysctl.c,v 1.16 1996/04/12 23:21:37 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
|
@ -164,8 +164,7 @@ sys___sysctl(p, v, retval)
|
|||
return (error);
|
||||
if (SCARG(uap, oldlenp))
|
||||
error = copyout(&oldlen, SCARG(uap, oldlenp), sizeof(oldlen));
|
||||
*retval = oldlen;
|
||||
return (0);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue