Source-Changes-HG archive

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

[src/trunk]: src/bin/sh CID 1225078: check getrlimit return



details:   https://anonhg.NetBSD.org/src/rev/f9650a336a14
branches:  trunk
changeset: 808188:f9650a336a14
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 09 13:28:55 2015 +0000

description:
CID 1225078: check getrlimit return

diffstat:

 bin/sh/miscbltin.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 0dfb2090cdf0 -r f9650a336a14 bin/sh/miscbltin.c
--- a/bin/sh/miscbltin.c        Sat May 09 13:26:06 2015 +0000
+++ b/bin/sh/miscbltin.c        Sat May 09 13:28:55 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: miscbltin.c,v 1.42 2012/06/11 18:28:10 njoly Exp $     */
+/*     $NetBSD: miscbltin.c,v 1.43 2015/05/09 13:28:55 christos Exp $  */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)miscbltin.c        8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: miscbltin.c,v 1.42 2012/06/11 18:28:10 njoly Exp $");
+__RCSID("$NetBSD: miscbltin.c,v 1.43 2015/05/09 13:28:55 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -427,7 +427,8 @@
                return 0;
        }
 
-       getrlimit(l->cmd, &limit);
+       if (getrlimit(l->cmd, &limit) == -1)
+               error("error getting limit (%s)", strerror(errno));
        if (set) {
                if (how & HARD)
                        limit.rlim_max = val;



Home | Main Index | Thread Index | Old Index