Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/rpcbind check setrlimit too



details:   https://anonhg.NetBSD.org/src/rev/edd8d41f468c
branches:  trunk
changeset: 338067:edd8d41f468c
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat May 09 18:22:37 2015 +0000

description:
check setrlimit too

diffstat:

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

diffs (20 lines):

diff -r c4b4149fe278 -r edd8d41f468c usr.sbin/rpcbind/rpcbind.c
--- a/usr.sbin/rpcbind/rpcbind.c        Sat May 09 18:18:32 2015 +0000
+++ b/usr.sbin/rpcbind/rpcbind.c        Sat May 09 18:22:37 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpcbind.c,v 1.20 2015/05/09 13:10:50 christos Exp $    */
+/*     $NetBSD: rpcbind.c,v 1.21 2015/05/09 18:22:37 dholland Exp $    */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -123,7 +123,9 @@
                        rl.rlim_cur = rl.rlim_max;
                else
                        rl.rlim_cur = 128;
-               setrlimit(RLIMIT_NOFILE, &rl);
+               if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
+                       err(EXIT_FAILURE, "setrlimit(RLIMIT_NOFILE)");
+               }
        }
        nc_handle = setnetconfig();     /* open netconfig file */
        if (nc_handle == NULL)



Home | Main Index | Thread Index | Old Index