Permalink
Browse files

die properly on getaddrinfo failure

  • Loading branch information...
1 parent 253e4b0 commit 09cdcad56cd1d76fa762e6b7656b14a66b1dd7a1 itojun committed Nov 11, 2000
Showing with 5 additions and 2 deletions.
  1. +5 −2 kame/kame/bindtest/bindtest.c
@@ -1,4 +1,4 @@
-/* $KAME: bindtest.c,v 1.13 2000/11/04 10:16:38 itojun Exp $ */
+/* $KAME: bindtest.c,v 1.14 2000/11/11 18:22:35 itojun Exp $ */
/*
* Copyright (C) 2000 USAGI Project.
@@ -143,8 +143,11 @@ main(argc, argv)
exit(1);
}
- for (testi = testitems; testi->name; testi++)
+ for (testi = testitems; testi->name; testi++) {
testi->res = getres(testi->family, testi->host, port);
+ if (!testi->res)
+ errx(1, "getaddrinfo failed");
+ }
printf("starting tests, socktype = %s%s%s\n",
socktype == SOCK_DGRAM ? "SOCK_DGRAM" : "SOCK_STREAM",

0 comments on commit 09cdcad

Please sign in to comment.