Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/rpcgen Prefer error messages resolved from errno ove...
details: https://anonhg.NetBSD.org/src/rev/f665d3923073
branches: trunk
changeset: 340625:f665d3923073
user: kamil <kamil%NetBSD.org@localhost>
date: Sun Sep 20 16:57:13 2015 +0000
description:
Prefer error messages resolved from errno over handwritten ones.
diffstat:
usr.bin/rpcgen/rpc_cout.c | 7 +++----
usr.bin/rpcgen/rpc_main.c | 6 +++---
usr.bin/rpcgen/rpc_util.c | 8 ++++----
3 files changed, 10 insertions(+), 11 deletions(-)
diffs (91 lines):
diff -r e5aaffb9a30d -r f665d3923073 usr.bin/rpcgen/rpc_cout.c
--- a/usr.bin/rpcgen/rpc_cout.c Sun Sep 20 16:39:04 2015 +0000
+++ b/usr.bin/rpcgen/rpc_cout.c Sun Sep 20 16:57:13 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rpc_cout.c,v 1.36 2015/05/09 23:16:51 dholland Exp $ */
+/* $NetBSD: rpc_cout.c,v 1.37 2015/09/20 16:57:13 kamil 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_cout.c 1.13 89/02/22 (C) 1987 SMI";
#else
-__RCSID("$NetBSD: rpc_cout.c,v 1.36 2015/05/09 23:16:51 dholland Exp $");
+__RCSID("$NetBSD: rpc_cout.c,v 1.37 2015/09/20 16:57:13 kamil Exp $");
#endif
#endif
@@ -478,8 +478,7 @@
nsizestr = realloc(sizestr, strlen(sizestr) + strlen(ptemp) + 1);
if (nsizestr == NULL) {
-
- errx(EXIT_FAILURE, "Out of memory");
+ err(EXIT_FAILURE, "realloc");
}
sizestr = nsizestr;
sizestr = strcat(sizestr, ptemp); /* build up length of
diff -r e5aaffb9a30d -r f665d3923073 usr.bin/rpcgen/rpc_main.c
--- a/usr.bin/rpcgen/rpc_main.c Sun Sep 20 16:39:04 2015 +0000
+++ b/usr.bin/rpcgen/rpc_main.c Sun Sep 20 16:57:13 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rpc_main.c,v 1.43 2015/09/20 16:39:04 kamil Exp $ */
+/* $NetBSD: rpc_main.c,v 1.44 2015/09/20 16:57:13 kamil Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";
#else
-__RCSID("$NetBSD: rpc_main.c,v 1.43 2015/09/20 16:39:04 kamil Exp $");
+__RCSID("$NetBSD: rpc_main.c,v 1.44 2015/09/20 16:57:13 kamil Exp $");
#endif
#endif
@@ -278,7 +278,7 @@
res = alloc(strlen(file) + strlen(ext) + 1);
if (res == NULL) {
- errx(1, "Out of memory");
+ err(EXIT_FAILURE, "Out of memory");
}
p = strrchr(file, '.');
if (p == NULL) {
diff -r e5aaffb9a30d -r f665d3923073 usr.bin/rpcgen/rpc_util.c
--- a/usr.bin/rpcgen/rpc_util.c Sun Sep 20 16:39:04 2015 +0000
+++ b/usr.bin/rpcgen/rpc_util.c Sun Sep 20 16:57:13 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rpc_util.c,v 1.17 2015/05/09 23:28:43 dholland Exp $ */
+/* $NetBSD: rpc_util.c,v 1.18 2015/09/20 16:57:13 kamil 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_util.c 1.11 89/02/22 (C) 1987 SMI";
#else
-__RCSID("$NetBSD: rpc_util.c,v 1.17 2015/05/09 23:28:43 dholland Exp $");
+__RCSID("$NetBSD: rpc_util.c,v 1.18 2015/09/20 16:57:13 kamil Exp $");
#endif
#endif
@@ -432,7 +432,7 @@
len = strlen(pname) + strlen(vname) + strlen(ARGEXT) + 3;
name = malloc(len);
if (!name) {
- errx(EXIT_FAILURE, "Out of memory");
+ err(EXIT_FAILURE, "malloc");
}
snprintf(name, len, "%s_%s_%s", locase(pname), vname, ARGEXT);
return (name);
@@ -447,7 +447,7 @@
bas_type *ptr;
if ((ptr = malloc(sizeof(bas_type))) == NULL) {
- errx(EXIT_FAILURE, "Out of memory");
+ err(EXIT_FAILURE, "malloc");
}
ptr->name = type;
ptr->length = len;
Home |
Main Index |
Thread Index |
Old Index