'ulimit' can overflow the int return value, so avoid the overflow by

subtracting one if ulimit returns -1.

Submitted by:	Miguel Angel Sagreras <msagre@cactus.fi.uba.ar>
This commit is contained in:
Nate Williams 1996-12-05 01:45:08 +00:00
parent e73bdb51f7
commit abcdd6ed84
1 changed files with 2 additions and 1 deletions

View File

@ -45,7 +45,7 @@
*
* @(#)sun_misc.c 8.1 (Berkeley) 6/18/93
*
* $Id: ibcs2_misc.c,v 1.9 1995/10/23 19:46:51 swallace Exp $
* $Id: ibcs2_misc.c,v 1.10 1996/06/12 05:03:08 gpalmer Exp $
*/
/*
@ -128,6 +128,7 @@ ibcs2_ulimit(p, uap, retval)
switch (SCARG(uap, cmd)) {
case IBCS2_GETFSIZE:
*retval = p->p_rlimit[RLIMIT_FSIZE].rlim_cur;
if (*retval == -1) *retval--;
return 0;
case IBCS2_SETFSIZE: /* XXX - fix this */
#ifdef notyet