diff options
| author | christos <christos@NetBSD.org> | 2015-05-09 15:12:12 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2015-05-09 15:12:12 +0000 |
| commit | 930c88d18bdff3573f53ff22aa4ad1ca5e574647 (patch) | |
| tree | 1210aab3ed7faf7d13768c60d9b933800a87eb71 /usr.bin | |
| parent | f0d1c495c7e65c6ef40bf888f6fe09829beba9e1 (diff) | |
CID 1225082: Check getrlimit() return
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/rpcgen/rpc_svcout.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c index 3ba5c2ce094..2c3bda38ae6 100644 --- a/usr.bin/rpcgen/rpc_svcout.c +++ b/usr.bin/rpcgen/rpc_svcout.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_svcout.c,v 1.26 2013/12/15 06:07:39 christos Exp $ */ +/* $NetBSD: rpc_svcout.c,v 1.27 2015/05/09 15:12:12 christos Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)rpc_svcout.c 1.29 89/03/30 (C) 1987 SMI"; #else -__RCSID("$NetBSD: rpc_svcout.c,v 1.26 2013/12/15 06:07:39 christos Exp $"); +__RCSID("$NetBSD: rpc_svcout.c,v 1.27 2015/05/09 15:12:12 christos Exp $"); #endif #endif @@ -646,7 +646,7 @@ write_timeout_func(void) f_print(fout, "static void closedown(void);\n"); f_print(fout, "\n"); f_print(fout, "static void\n"); - f_print(fout, "closedown()\n"); + f_print(fout, "closedown(void)\n"); f_print(fout, "{\n"); f_print(fout, "\tif (_rpcsvcdirty == 0) {\n"); f_print(fout, "\t\textern fd_set svc_fdset;\n"); @@ -663,7 +663,8 @@ write_timeout_func(void) if (tirpcflag) { f_print(fout, "\t\t\tstruct rlimit rl;\n\n"); f_print(fout, "\t\t\trl.rlim_max = 0;\n"); - f_print(fout, "\t\t\tgetrlimit(RLIMIT_NOFILE, &rl);\n"); + f_print(fout, "\t\t\tif (getrlimit(RLIMIT_NOFILE, &rl) == -1)\n"); + f_print(fout, "\t\t\t\treturn;\n"); f_print(fout, "\t\t\tif ((size = rl.rlim_max) == 0)\n"); f_print(fout, "\t\t\t\treturn;\n"); } else { |
