Module Name:    src
Committed By:   christos
Date:           Sat May  9 13:10:50 UTC 2015

Modified Files:
        src/usr.sbin/rpcbind: rpcbind.c

Log Message:
CID 1009289: Check getrlimit


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/rpcbind/rpcbind.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/rpcbind/rpcbind.c
diff -u src/usr.sbin/rpcbind/rpcbind.c:1.19 src/usr.sbin/rpcbind/rpcbind.c:1.20
--- src/usr.sbin/rpcbind/rpcbind.c:1.19	Sat Oct 19 13:16:38 2013
+++ src/usr.sbin/rpcbind/rpcbind.c	Sat May  9 09:10:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpcbind.c,v 1.19 2013/10/19 17:16:38 christos Exp $	*/
+/*	$NetBSD: rpcbind.c,v 1.20 2015/05/09 13:10:50 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -118,8 +118,7 @@ main(int argc, char *argv[])
 
 	parseargs(argc, argv);
 
-	getrlimit(RLIMIT_NOFILE, &rl);
-	if (rl.rlim_cur < 128) {
+	if (getrlimit(RLIMIT_NOFILE, &rl) != -1 && rl.rlim_cur < 128) {
 		if (rl.rlim_max <= 128)
 			rl.rlim_cur = rl.rlim_max;
 		else

Reply via email to