Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/net besure to check getnameinfo() return value. (d...
details: https://anonhg.NetBSD.org/src/rev/cf34254d3418
branches: trunk
changeset: 487855:cf34254d3418
user: itojun <itojun%NetBSD.org@localhost>
date: Wed Jun 14 01:52:41 2000 +0000
description:
besure to check getnameinfo() return value. (debugging code)
diffstat:
lib/libc/net/res_send.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diffs (33 lines):
diff -r e8618ec0ead0 -r cf34254d3418 lib/libc/net/res_send.c
--- a/lib/libc/net/res_send.c Wed Jun 14 00:34:33 2000 +0000
+++ b/lib/libc/net/res_send.c Wed Jun 14 01:52:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: res_send.c,v 1.27 2000/04/26 10:55:53 itojun Exp $ */
+/* $NetBSD: res_send.c,v 1.28 2000/06/14 01:52:41 itojun Exp $ */
/*-
* Copyright (c) 1985, 1989, 1993
@@ -59,7 +59,7 @@
static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "Id: res_send.c,v 8.13 1997/06/01 20:34:37 vixie Exp ";
#else
-__RCSID("$NetBSD: res_send.c,v 1.27 2000/04/26 10:55:53 itojun Exp $");
+__RCSID("$NetBSD: res_send.c,v 1.28 2000/06/14 01:52:41 itojun Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -143,9 +143,12 @@
int save = errno;
if (_res.options & RES_DEBUG) {
- getnameinfo(address, (size_t)address->sa_len, abuf,
+ if (getnameinfo(address, (size_t)address->sa_len, abuf,
sizeof(abuf), pbuf, sizeof(pbuf),
- NI_NUMERICHOST|NI_NUMERICSERV|NI_WITHSCOPEID);
+ NI_NUMERICHOST|NI_NUMERICSERV|NI_WITHSCOPEID) != 0) {
+ strcpy(abuf, "?");
+ strcpy(pbuf, "?");
+ }
fprintf(file, "res_send: %s ([%s].%s): %s\n",
string, abuf, pbuf, strerror(error));
}
Home |
Main Index |
Thread Index |
Old Index