From: millert Date: Fri, 28 Feb 1997 00:46:33 +0000 (+0000) Subject: Slightly more sane rlimit usage. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=38780ef0b4c51c963fd6a153d9665bfcbfa58dc1;p=openbsd Slightly more sane rlimit usage. --- diff --git a/sbin/fsirand/fsirand.c b/sbin/fsirand/fsirand.c index 0049a1de411..0e4d9311842 100644 --- a/sbin/fsirand/fsirand.c +++ b/sbin/fsirand/fsirand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fsirand.c,v 1.8 1997/02/22 06:46:23 millert Exp $ */ +/* $OpenBSD: fsirand.c,v 1.9 1997/02/28 00:46:33 millert Exp $ */ /* * Copyright (c) 1997 Todd C. Miller @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: fsirand.c,v 1.8 1997/02/22 06:46:23 millert Exp $"; +static char rcsid[] = "$OpenBSD: fsirand.c,v 1.9 1997/02/28 00:46:33 millert Exp $"; #endif /* not lint */ #include @@ -86,12 +86,13 @@ main(argc, argv) if (argc - optind < 1) usage(1); - /* Increase our max data size */ - if (getrlimit(RLIMIT_DATA, &rl) < 0) - warn("getrlimit"); - rl.rlim_cur = rl.rlim_max; - if (setrlimit(RLIMIT_DATA, &rl) < 0) - warn("setrlimit"); + /* Increase our data size to the max */ + if (getrlimit(RLIMIT_DATA, &rl) == 0) { + rl.rlim_cur = rl.rlim_max; + if (setrlimit(RLIMIT_DATA, &rl) < 0) + warn("Can't get resource limit to max data size"); + } else + warn("Can't get resource limit for data size"); for (n = optind; n < argc; n++) { if (argc - optind != 1)