Module Name: src
Committed By: kamil
Date: Sun Sep 20 16:57:13 UTC 2015
Modified Files:
src/usr.bin/rpcgen: rpc_cout.c rpc_main.c rpc_util.c
Log Message:
Prefer error messages resolved from errno over handwritten ones.
To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/rpcgen/rpc_cout.c
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/rpcgen/rpc_main.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/rpcgen/rpc_util.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/rpcgen/rpc_cout.c
diff -u src/usr.bin/rpcgen/rpc_cout.c:1.36 src/usr.bin/rpcgen/rpc_cout.c:1.37
--- src/usr.bin/rpcgen/rpc_cout.c:1.36 Sat May 9 23:16:51 2015
+++ src/usr.bin/rpcgen/rpc_cout.c Sun Sep 20 16:57:13 2015
@@ -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 @@ emit_struct(definition *def)
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
Index: src/usr.bin/rpcgen/rpc_main.c
diff -u src/usr.bin/rpcgen/rpc_main.c:1.43 src/usr.bin/rpcgen/rpc_main.c:1.44
--- src/usr.bin/rpcgen/rpc_main.c:1.43 Sun Sep 20 16:39:04 2015
+++ src/usr.bin/rpcgen/rpc_main.c Sun Sep 20 16:57:13 2015
@@ -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 @@ extendfile(const char *path, const char
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) {
Index: src/usr.bin/rpcgen/rpc_util.c
diff -u src/usr.bin/rpcgen/rpc_util.c:1.17 src/usr.bin/rpcgen/rpc_util.c:1.18
--- src/usr.bin/rpcgen/rpc_util.c:1.17 Sat May 9 23:28:43 2015
+++ src/usr.bin/rpcgen/rpc_util.c Sun Sep 20 16:57:13 2015
@@ -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 @@ make_argname(const char *pname, const ch
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 @@ add_type(int len, const char *type)
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;