]> Savannah Git Hosting - gnulib.git/commitdiff
servent tests: Fix failure due to missing htons declaration.
authorCollin Funk <collin.funk1@gmail.com>
Wed, 1 Jan 2025 03:51:26 +0000 (19:51 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Wed, 1 Jan 2025 03:51:26 +0000 (19:51 -0800)
* modules/servent-tests (Depends-on): Add htonl.
(Makefile.am): Link program to $(HTONL_LIB).
* tests/test-servent.c (main): Fix formatting and typo.

ChangeLog
modules/servent-tests
tests/test-servent.c

index 489d0d985c932a45fac4867aa200e53234c9be86..2f00298d383d087af52e13cd38e5d47209fc8206 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2024-12-31  Collin Funk  <collin.funk1@gmail.com>
 
+       servent tests: Fix failure due to missing htons declaration.
+       * modules/servent-tests (Depends-on): Add htonl.
+       (Makefile.am): Link program to $(HTONL_LIB).
+       * tests/test-servent.c (main): Fix formatting and typo.
+
        servent: Make sure netdb.h is generated.
        * modules/servent (Depends-on): Add netdb-h.
 
index 90bdc63809b954cab48c69721404654fa7d22292..98ef534879ce3093b8cce44c764b56a00032034f 100644 (file)
@@ -3,10 +3,11 @@ tests/test-servent.c
 tests/signature.h
 
 Depends-on:
+htonl
 
 configure.ac:
 
 Makefile.am:
 TESTS += test-servent
 check_PROGRAMS += test-servent
-test_servent_LDADD = $(LDADD) $(SERVENT_LIB)
+test_servent_LDADD = $(LDADD) $(SERVENT_LIB) $(HTONL_LIB)
index 5a9997b5165482ff703c2e3b2b10a03e1f512aec..275fe883b2834f23bea4d60b8e9a2efe0d9eea40 100644 (file)
@@ -38,9 +38,9 @@ main (void)
   if (result == NULL)
     fputs ("getservbyname failed\n", stderr);
 
-  result = getservbyport (htons(53), "tcp");
+  result = getservbyport (htons (53), "tcp");
   if (result == NULL)
-    fputs ("getportbyname failed\n", stderr);
+    fputs ("getservbyport failed\n", stderr);
 
   return 0;
 }