Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/rpcbind CID 1009289: Check getrlimit



details:   https://anonhg.NetBSD.org/src/rev/5731cf318291
branches:  trunk
changeset: 338041:5731cf318291
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 09 13:10:50 2015 +0000

description:
CID 1009289: Check getrlimit

diffstat:

 usr.sbin/rpcbind/rpcbind.c |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r f6ba7d18c36f -r 5731cf318291 usr.sbin/rpcbind/rpcbind.c
--- a/usr.sbin/rpcbind/rpcbind.c        Sat May 09 13:08:26 2015 +0000
+++ b/usr.sbin/rpcbind/rpcbind.c        Sat May 09 13:10:50 2015 +0000
@@ -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 @@
 
        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



Home | Main Index | Thread Index | Old Index