diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-09-25 23:02:44 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-09-25 23:02:44 +0000 |
commit | 2b54f967b0ccdb68001c04ccae90301ec1f17492 (patch) | |
tree | 5a9d8343d6d932984d1448e4c7d257d1e5d387d0 /lib | |
parent | 85f6b7814c6840343c4e5b0719a963eccb544864 (diff) |
Remove unnecessary /* NOTREACHED */ comments because our lint is
cool and recognizes __dead, and because shorter examples are clearer.
OK otto@.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/getaddrinfo.3 | 18 | ||||
-rw-r--r-- | lib/libc/net/getnameinfo.3 | 10 |
2 files changed, 8 insertions, 20 deletions
diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3 index 12a0d8ce12b..8b9026820f7 100644 --- a/lib/libc/net/getaddrinfo.3 +++ b/lib/libc/net/getaddrinfo.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getaddrinfo.3,v 1.43 2005/11/15 19:35:31 otto Exp $ +.\" $OpenBSD: getaddrinfo.3,v 1.44 2006/09/25 23:02:43 ray Exp $ .\" $KAME: getaddrinfo.3,v 1.36 2005/01/05 03:23:05 itojun Exp $ .\" .\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -312,10 +312,8 @@ memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo("www.kame.net", "www", &hints, &res0); -if (error) { +if (error) errx(1, "%s", gai_strerror(error)); - /*NOTREACHED*/ -} s = -1; for (res = res0; res; res = res->ai_next) { s = socket(res->ai_family, res->ai_socktype, @@ -336,10 +334,8 @@ for (res = res0; res; res = res->ai_next) { break; /* okay we got one */ } -if (s < 0) { +if (s < 0) err(1, "%s", cause); - /*NOTREACHED*/ -} freeaddrinfo(res0); .Ed .Pp @@ -359,10 +355,8 @@ hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; error = getaddrinfo(NULL, "www", &hints, &res0); -if (error) { +if (error) errx(1, "%s", gai_strerror(error)); - /*NOTREACHED*/ -} nsock = 0; for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) { s[nsock] = socket(res->ai_family, res->ai_socktype, @@ -383,10 +377,8 @@ for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) { nsock++; } -if (nsock == 0) { +if (nsock == 0) err(1, "%s", cause); - /*NOTREACHED*/ -} freeaddrinfo(res0); .Ed .Sh SEE ALSO diff --git a/lib/libc/net/getnameinfo.3 b/lib/libc/net/getnameinfo.3 index b17f2e4aeb2..726aa0a9943 100644 --- a/lib/libc/net/getnameinfo.3 +++ b/lib/libc/net/getnameinfo.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getnameinfo.3,v 1.38 2005/01/29 00:49:47 jmc Exp $ +.\" $OpenBSD: getnameinfo.3,v 1.39 2006/09/25 23:02:43 ray Exp $ .\" $KAME: getnameinfo.3,v 1.37 2005/01/05 03:23:05 itojun Exp $ .\" .\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -137,10 +137,8 @@ struct sockaddr *sa; /* input */ char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), sbuf, - sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV)) { + sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV)) errx(1, "could not get numeric hostname"); - /*NOTREACHED*/ -} printf("host=%s, serv=%s\en", hbuf, sbuf); .Ed .Pp @@ -150,10 +148,8 @@ struct sockaddr *sa; /* input */ char hbuf[NI_MAXHOST]; if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0, - NI_NAMEREQD)) { + NI_NAMEREQD)) errx(1, "could not resolve hostname"); - /*NOTREACHED*/ -} printf("host=%s\en", hbuf); .Ed .Sh SEE ALSO |