diff options
| author | kamil <kamil@NetBSD.org> | 2015-09-20 16:57:13 +0000 |
|---|---|---|
| committer | kamil <kamil@NetBSD.org> | 2015-09-20 16:57:13 +0000 |
| commit | bd2f57fa1249e89cdfeecea948ed36e63cded50d (patch) | |
| tree | 5f3ee1142aac9bbc0048da1b7c2bd67900c57000 /usr.bin | |
| parent | 1c1b95e4ab8705cda42b474887f2703b320817a6 (diff) | |
Prefer error messages resolved from errno over handwritten ones.
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/rpcgen/rpc_cout.c | 7 | ||||
| -rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 6 | ||||
| -rw-r--r-- | usr.bin/rpcgen/rpc_util.c | 8 |
3 files changed, 10 insertions, 11 deletions
diff --git a/usr.bin/rpcgen/rpc_cout.c b/usr.bin/rpcgen/rpc_cout.c index 65cb389a631..7fa0d68c9e4 100644 --- a/usr.bin/rpcgen/rpc_cout.c +++ b/usr.bin/rpcgen/rpc_cout.c @@ -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 diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index b731bc5eda6..c26bbd166fa 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -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 *ext) 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 --git a/usr.bin/rpcgen/rpc_util.c b/usr.bin/rpcgen/rpc_util.c index 4ef77397f81..7601d91a53a 100644 --- a/usr.bin/rpcgen/rpc_util.c +++ b/usr.bin/rpcgen/rpc_util.c @@ -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 char *vname) 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; |
