Avoid sign extention problems leading to:
$ ulimit -dH 3145728 $ ulimit -d 3145728 ksh: ulimit: bad limit: Invalid argument $
This commit is contained in:
parent
e1dadf87f1
commit
2a76c8a41c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: c_ulimit.c,v 1.8 2006/10/16 00:07:32 christos Exp $ */
|
||||
/* $NetBSD: c_ulimit.c,v 1.9 2008/09/14 05:00:23 sjg Exp $ */
|
||||
|
||||
/*
|
||||
ulimit -- handle "ulimit" builtin
|
||||
|
@ -20,7 +20,7 @@
|
|||
#include <sys/cdefs.h>
|
||||
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: c_ulimit.c,v 1.8 2006/10/16 00:07:32 christos Exp $");
|
||||
__RCSID("$NetBSD: c_ulimit.c,v 1.9 2008/09/14 05:00:23 sjg Exp $");
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -193,7 +193,7 @@ c_ulimit(wp)
|
|||
bi_errorf("invalid limit: %s", wp[0]);
|
||||
return 1;
|
||||
}
|
||||
val = rval * l->factor;
|
||||
val = (u_long)rval * l->factor;
|
||||
}
|
||||
}
|
||||
if (all) {
|
||||
|
|
Loading…
Reference in New Issue