Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/stdlib As err(3) instructs, use EXIT_FAILURE in the...



details:   https://anonhg.NetBSD.org/src/rev/efc0398626c6
branches:  trunk
changeset: 754431:efc0398626c6
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Fri Apr 30 07:14:15 2010 +0000

description:
As err(3) instructs, use EXIT_FAILURE in the example.

diffstat:

 lib/libc/stdlib/malloc.3 |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 2f2d0a04cacf -r efc0398626c6 lib/libc/stdlib/malloc.3
--- a/lib/libc/stdlib/malloc.3  Fri Apr 30 07:00:51 2010 +0000
+++ b/lib/libc/stdlib/malloc.3  Fri Apr 30 07:14:15 2010 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: malloc.3,v 1.31 2010/04/30 07:00:51 jruoho Exp $
+.\" $NetBSD: malloc.3,v 1.32 2010/04/30 07:14:15 jruoho Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -83,7 +83,7 @@
 be careful to avoid the following idiom:
 .Bd -literal -offset indent
 if ((p = malloc(number * size)) == NULL)
-       err(1, "malloc");
+       err(EXIT_FAILURE, "malloc");
 .Ed
 .Pp
 The multiplication may lead to an integer overflow.
@@ -97,7 +97,7 @@
 .Bd -literal -offset indent
 if (size && number > SIZE_MAX / size) {
        errno = ENOMEM;
-       err(1, "overflow");
+       err(EXIT_FAILURE, "overflow");
 }
 .Ed
 .Pp



Home | Main Index | Thread Index | Old Index