commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-168-g9aa72


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-168-g9aa72c7
Date: Thu, 13 Sep 2012 20:33:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  9aa72c7a975724fa70f4025b47ce3ee4723b75bd (commit)
       via  78079c52085a164b3e8feeb71b41c85988ba008d (commit)
       via  a69f322c049b6645330472393021733018de9fd0 (commit)
       via  64d135fa07aff893864faadf5ca8014c8389f6b2 (commit)
      from  43b1d34579512f4257dcb1230d3edf59a25749c0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=9aa72c7a975724fa70f4025b47ce3ee4723b75bd


commit 9aa72c7a975724fa70f4025b47ce3ee4723b75bd
Author: Mats Erik Andersson <address@hidden>
Date:   Thu Sep 13 00:52:18 2012 +0200

    Configuration of library linkage.

diff --git a/ChangeLog b/ChangeLog
index ce584e4..adbf56a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
 2012-09-13  Mats Erik Andersson  <address@hidden>
 
+       Use libdl only when needed, i.e., with libpam.
+
+       * configure.ac (LIBDL): New variable.  Publish it
+       using AC_SUBST.  When calling AC_CHECK_LIB for
+       dlopen in libdl, add the action `LIBDL=-ldl' which
+       avoids a global change of LIBS.
+       * ftpd/Makefile.am (LDADD): Add $(LIBDL).
+       * src/Makefile.am (rexecd_LDADD, rshd_LDADD): Likewise.
+
+       Link libnsl, libresolv or libsocket only if needed.
+
+       * configure.ac: Use AC_SEARCH_LIBS instead of AC_CHECK_LIB
+       when sensing for libnsl, libresolv, and libsocket.
+
+       Refine libidn detection and specification.
+
+       * configure.ac <--with-libidn-prefix>: New option.
+       <libidn detection>: Call AC_MSG_CHECKING after other
+       checks, and call AC_MSG_RESULT with correct variable.
+       Preload INCIDN and LIBIDN from $with_libidn_prefix.
+       In call to AC_CHECKLIB(idn, ...), use preset LIBIDN.
+       In summary message, print `-lidn' instead of LIBIDN.
+
+2012-09-13  Mats Erik Andersson  <address@hidden>
+
        * ifconfig/changeif.c (herror prototype)
        [!HAVE_DECL_GETADDRINFO]: Conditional use of prototype.
        (set_address) [HAVE_DECL_GETADDRINFO]: New variables RC,
diff --git a/configure.ac b/configure.ac
index 8681b98..2ad090b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,9 +87,13 @@ AC_ARG_WITH([pam],
             AC_HELP_STRING([--with-pam],
                            [Add support for PAM]))
 AC_ARG_WITH([idn],
-  AC_HELP_STRING([--with-idn],
+  AC_HELP_STRING([--with-idn[[=DIR]]],
                 [Use IDN support, with optional inclusion directory]), ,
                 [with_idn=no])
+AC_ARG_WITH([libidn-prefix],
+  AC_HELP_STRING([--with-libidn-prefix[[=DIR]]],
+                [Base directory, probes DIR/include and DIR/lib]), ,
+                [with_libidn_prefix=no])
 
 IU_ENABLE_SERVER(ftpd)
 IU_ENABLE_SERVER(inetd)
@@ -150,9 +154,9 @@ AC_ARG_VAR(NETSTAT, [Location of 'netstat'.])
 gl_INIT
 
 ### Checks for libraries.
-AC_CHECK_LIB(nsl, inet_ntoa)
-AC_CHECK_LIB(resolv, gethostname)
-AC_CHECK_LIB(socket, getpeername)
+AC_SEARCH_LIBS([inet_ntoa], [nsl])
+AC_SEARCH_LIBS([gethostname], [resolv])
+AC_SEARCH_LIBS([getpeername], [socket])
 
 # See if a termcap library is available (under one of several names)
 IU_LIB_TERMCAP
@@ -196,7 +200,7 @@ fi
 
 # See if we have libpam.a.  Investigate PAM versus Linux-PAM.
 if test "$with_pam" = yes ; then
-  AC_CHECK_LIB(dl, dlopen)
+  AC_CHECK_LIB(dl, dlopen, LIBDL=-ldl)
   AC_CHECK_LIB(pam, pam_authenticate, LIBPAM=-lpam)
   if test "$ac_cv_lib_pam_pam_authenticate" = yes ; then
     AC_DEFINE([WITH_PAM], 1, [Define to one if you have -lpam.])
@@ -208,6 +212,7 @@ if test "$with_pam" = yes ; then
     fi
   fi
 fi
+AC_SUBST(LIBDL)
 AC_SUBST(LIBPAM)
 AC_SUBST(FTPD_LIBPAM)
 
@@ -564,10 +569,15 @@ AC_SUBST(LIBWRAP)
 ### Check for GNU Libidn
 AC_CHECK_HEADERS([locale.h])
 AC_CHECK_FUNCS([setlocale])
+
 if test x"$with_idn" != xno \
     && test "$ac_cv_header_locale_h" = yes \
     && test "$ac_cv_func_setlocale" = yes; then
-  AC_MSG_CHECKING([if GNU libidn is available])
+  if test x"$with_libidn_prefix" != xno \
+      && test x"$with_libidn_prefix" != xyes; then
+    INCIDN=-I$with_libidn_prefix/include
+    LIBIDN=-L$with_libidn_prefix/lib
+  fi
   if test x"$with_idn" != xyes; then
     INCIDN=-I$with_idn
   fi
@@ -575,12 +585,15 @@ if test x"$with_idn" != xno \
   CPPFLAGS="$CPPFLAGS $INCIDN"
   AC_CHECK_HEADERS([idna.h])
   if test "$ac_cv_header_idna_h" = yes; then
-    AC_CHECK_LIB(idn, idna_to_ascii_lz, [LIBIDN=-lidn], [INCIDN=])
+    AC_CHECK_LIB(idn, idna_to_ascii_lz,
+                [LIBIDN="$LIBIDN -lidn"], [INCIDN= LIBIDN=],
+                [$LIBIDN])
+    AC_MSG_CHECKING([if GNU libidn is available])
     if test "$ac_cv_lib_idn_idna_to_ascii_lz" = yes; then
       AC_DEFINE(HAVE_IDN, 1, [Define to 1 for use of GNU Libidn.])
     fi
+    AC_MSG_RESULT($ac_cv_lib_idn_idna_to_ascii_lz)
   fi
-  AC_MSG_RESULT($ac_cv_lib_idna_to_ascii_lz)
   CPPFLAGS=$save_CPPFLAGS
 fi
 AC_SUBST([LIBIDN])
@@ -995,9 +1008,9 @@ ${ftp_BUILD:+${LIBREADLINE:+$LIBREADLINE }$LIBTERMCAP}
     ifconfig       ${enable_ifconfig}
     logger         ${enable_logger}
     ping           ${enable_ping}  \
-${ping_BUILD:+$LIBIDN}
+${ping_BUILD:+${LIBIDN:+-libidn}}
     ping6          ${enable_ping6}  \
-${ping6_BUILD:+$LIBIDN}
+${ping6_BUILD:+${LIBIDN:+-libidn}}
     rcp            ${enable_rcp}  \
 ${rcp_BUILD:+$KERBEROS_VERSION}
     rexec          ${enable_rexec}
@@ -1011,7 +1024,7 @@ ${talk_BUILD:+$LIBCURSES}
 ${telnet_BUILD:+${KERBEROS_VERSION:+$KERBEROS_VERSION }$LIBTERMCAP}
     tftp           ${enable_tftp}
     traceroute     ${enable_traceroute}  \
-${traceroute_BUILD:+$LIBIDN}
+${traceroute_BUILD:+${LIBIDN:+-libidn}}
     whois          ${enable_whois}
 
   Servers:
diff --git a/ftpd/Makefile.am b/ftpd/Makefile.am
index c9b4e8f..dd54ba7 100644
--- a/ftpd/Makefile.am
+++ b/ftpd/Makefile.am
@@ -36,6 +36,6 @@ AM_CPPFLAGS = $(PATHDEF_FTPWELCOME) $(PATHDEF_FTPUSERS) \
            $(PATHDEF_FTPLOGINMESG) $(PATHDEF_FTPCHROOT) $(PATHDEF_FTPDPID) \
            $(PATHDEF_DEVNULL)  $(PATHDEF_NOLOGIN) $(PATHDEF_BSHELL)
 
-LDADD = $(LIBLS) $(LIBCRYPT) $(LIBWRAP) $(FTPD_LIBPAM) $(iu_LIBRARIES)
+LDADD = $(LIBLS) $(LIBCRYPT) $(LIBWRAP) $(FTPD_LIBPAM) $(LIBDL) $(iu_LIBRARIES)
 
 EXTRA_DIST = ftpcmd.c
diff --git a/src/Makefile.am b/src/Makefile.am
index c812453..1f7bf13 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -74,7 +74,7 @@ EXTRA_PROGRAMS += inetd
 
 inetdaemon_PROGRAMS += $(rexecd_BUILD)
 rexecd_SOURCES = rexecd.c
-rexecd_LDADD = $(LDADD) $(LIBCRYPT) $(LIBPAM)
+rexecd_LDADD = $(LDADD) $(LIBCRYPT) $(LIBPAM) $(LIBDL)
 EXTRA_PROGRAMS += rexecd
 
 inetdaemon_PROGRAMS += $(rlogind_BUILD)
@@ -84,7 +84,7 @@ EXTRA_PROGRAMS += rlogind
 
 inetdaemon_PROGRAMS += $(rshd_BUILD)
 rshd_SOURCES = rshd.c
-rshd_LDADD = $(LDADD) $(LIBAUTH) $(LIBPAM)
+rshd_LDADD = $(LDADD) $(LIBAUTH) $(LIBPAM) $(LIBDL)
 EXTRA_PROGRAMS += rshd
 
 inetdaemon_PROGRAMS += $(syslogd_BUILD)

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=78079c52085a164b3e8feeb71b41c85988ba008d


commit 78079c52085a164b3e8feeb71b41c85988ba008d
Author: Mats Erik Andersson <address@hidden>
Date:   Thu Sep 13 00:48:10 2012 +0200

    Address resolution alternative.

diff --git a/ChangeLog b/ChangeLog
index a018436..ce584e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-09-13  Mats Erik Andersson  <address@hidden>
+
+       * ifconfig/changeif.c (herror prototype)
+       [!HAVE_DECL_GETADDRINFO]: Conditional use of prototype.
+       (set_address) [HAVE_DECL_GETADDRINFO]: New variables RC,
+       ADDR, HINTS, AI, and RES.  New, alternate code for address
+       resolution using getaddrinfo() and getnameinfo().
+
+       * libinetutils/localhost.c (localhost) [HAVE_DECL_GETADDRINFO]:
+       New variables RC, HINTS, RES, and FQDN.  New, alternate code
+       for address resolution.
+
+       * tests/Makefile.am (TESTS): Add `localhost' as test case.
+
 2012-09-11  Mats Erik Andersson  <address@hidden>
 
        * ftpd/ftpcmd.y (cmd): Add parantheses to separate
diff --git a/ifconfig/changeif.c b/ifconfig/changeif.c
index 2ce3347..c474883 100644
--- a/ifconfig/changeif.c
+++ b/ifconfig/changeif.c
@@ -52,7 +52,9 @@
       return -1;                                                       \
     }
 
+#ifndef HAVE_DECL_GETADDRINFO
 extern void herror (const char *pfx);
+#endif
 
 /* Set address of interface in IFR. Destroys union in IFR, but leaves
    ifr_name intact.  ADDRESS may be an IP number or a hostname that
@@ -65,6 +67,41 @@ set_address (int sfd, struct ifreq *ifr, char *address)
           "don't know how to set an interface address on this system");
   return -1;
 #else
+# ifdef HAVE_DECL_GETADDRINFO
+  int rc;
+  char addr[INET_ADDRSTRLEN];
+  struct addrinfo hints, *ai, *res;
+
+  memset (&hints, 0, sizeof (hints));
+  hints.ai_family = AF_INET;
+
+  rc = getaddrinfo (address, NULL, &hints, &res);
+  if (rc)
+    {
+      error (0, 0, "cannot resolve `%s': %s", address, gai_strerror (rc));
+      return -1;
+    }
+  for (ai = res; ai; ai = ai->ai_next)
+    if (ai->ai_family == AF_INET)
+      break;
+
+  if (ai == NULL)
+    {
+      error (0, 0, "`%s' refers to an unknown address type", address);
+      freeaddrinfo (res);
+      return -1;
+    }
+
+  rc = getnameinfo (ai->ai_addr, ai->ai_addrlen,
+                   addr, sizeof (addr), NULL, 0,
+                   NI_NUMERICHOST);
+  freeaddrinfo (res);
+  if (rc)
+    {
+      error (0, 0, "cannot resolve `%s': %s", address, gai_strerror (rc));
+      return -1;
+    }
+# else /* !HAVE_DECL_GETADDRINFO */
   char *addr;
   struct hostent *host = gethostbyname (address);
 
@@ -80,9 +117,11 @@ set_address (int sfd, struct ifreq *ifr, char *address)
     }
 
   addr = inet_ntoa (*((struct in_addr *) host->h_addr));
+# endif /* !HAVE_DECL_GETADDRINFO */
 
   {
-    SIOCSIF (ADDR, addr) if (verbose)
+    SIOCSIF (ADDR, addr)
+    if (verbose)
       printf ("Set interface address of `%s' to %s.\n",
              ifr->ifr_name, inet_ntoa (sin->sin_addr));
   }
diff --git a/libinetutils/localhost.c b/libinetutils/localhost.c
index da168bb..1228e08 100644
--- a/libinetutils/localhost.c
+++ b/libinetutils/localhost.c
@@ -33,11 +33,12 @@
 #include <netdb.h>
 
 /* Return the name of the localhost.  This is just a wrapper for gethostname,
-   which takes care of allocating a big enough buffer, and caches the result
+   taking care of allocating a big enough buffer, and caching the result
    after the first call (so the result should be copied before modification).
-   If something goes wrong, 0 is returned, and errno set.  */
-/* We know longer use static buffers, is to dangerous and
-   cause subtile bugs.  */
+   If something goes wrong, 0 is returned, and errno is set.
+ */
+/* We no longer use static buffers, as it is too dangerous and
+   it causes subtile bugs.  */
 char *
 localhost (void)
 {
@@ -75,8 +76,31 @@ localhost (void)
       buf = 0;
     }
   else
-    /* Determine FQDN */
+    /* Determine FQDN.  */
     {
+#ifdef HAVE_DECL_GETADDRINFO
+      int rc;
+      struct addrinfo hints, *res;
+      char fqdn[NI_MAXHOST];
+
+      memset (&hints, 0, sizeof (hints));
+      hints.ai_family = AF_INET;
+
+      rc = getaddrinfo (buf, NULL, &hints, &res);
+      if (!rc)
+       {
+         /* Back resolving as official host name.  */
+         rc = getnameinfo (res->ai_addr, res->ai_addrlen,
+                           fqdn, sizeof (fqdn), NULL, 0,
+                           NI_NAMEREQD);
+         if (!rc)
+           {
+             free (buf);
+             buf = strdup (fqdn);
+           }
+         freeaddrinfo (res);
+       }
+#else /* !HAVE_DECL_GETADDRINFO */
       struct hostent *hp = gethostbyname (buf);
 
       if (hp)
@@ -90,6 +114,7 @@ localhost (void)
              buf = strdup (hp->h_name);
            }
        }
+#endif /* !HAVE_DECL_GETADDRINFO */
     }
   return buf;
 }
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0a9ba70..f26247d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -68,7 +68,7 @@ if ENABLE_dnsdomainname
 dist_check_SCRIPTS += dnsdomainname.sh
 endif
 
-TESTS = $(dist_check_SCRIPTS)
+TESTS = localhost $(dist_check_SCRIPTS)
 
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT)
 

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=a69f322c049b6645330472393021733018de9fd0


commit a69f322c049b6645330472393021733018de9fd0
Author: Mats Erik Andersson <address@hidden>
Date:   Tue Sep 11 19:25:38 2012 +0200

    ftpd, libls: Compiler warnings.

diff --git a/ChangeLog b/ChangeLog
index 5496d5e..a018436 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2012-09-11  Mats Erik Andersson  <address@hidden>
+
+       * ftpd/ftpcmd.y (cmd): Add parantheses to separate
+       subordinate && from ||.
+       * ftpd/ftpd.c (off_to_str): Cast OFF as long.
+       (options): Fill in missing fields.
+       (main) [!HAVE_INITSETPROCTITLE]: Trivially use envp.
+       * ftpd/pam.c: Include <unused-parameter.h>.
+       (pam_pass): Cast passwd as `char *'.
+       (pam_end_login): Add _GL_UNUSED_PARAMETER.
+       * ftpd/popen.c (ls_main prototype) [WITH_LIBLS]:
+       Enclose within conditional WITH_LIBLS.
+       * ftpd/server_mode.c (server_mode) [HAVE_FORK]:
+       Trivially use argv.
+       * libls/fts.c: Include <unused-parameter.h>.
+       (fts_set): Add _GL_UNUSED_PARAMETER.
+       * libls/ls.c (display): Cast MAXSIZE as off_t.
+
 2012-09-10  Mats Erik Andersson  <address@hidden>
 
        * ping/ping.c (ping_finish): Replace format string "%ld"
diff --git a/ftpd/ftpcmd.y b/ftpd/ftpcmd.y
index 1bfe92b..278cb90 100644
--- a/ftpd/ftpcmd.y
+++ b/ftpd/ftpcmd.y
@@ -197,19 +197,19 @@ cmd
                {
                        if ($2) {
                                if ($4
-                                   && (his_addr.ss_family == AF_INET
+                                   && ((his_addr.ss_family == AF_INET
                                        && memcmp (&((struct sockaddr_in *) 
&his_addr)->sin_addr,
                                                   &((struct sockaddr_in *) 
&data_dest)->sin_addr,
                                                   sizeof (struct in_addr)) == 0
                                        && ntohs (((struct sockaddr_in *) 
&data_dest)->sin_port)
-                                          > IPPORT_RESERVED
+                                          > IPPORT_RESERVED)
                                        ||
-                                       his_addr.ss_family == AF_INET6
+                                       (his_addr.ss_family == AF_INET6
                                        && memcmp (&((struct sockaddr_in6 *) 
&his_addr)->sin6_addr,
                                                   &((struct sockaddr_in6 *) 
&data_dest)->sin6_addr,
                                                   sizeof (struct in6_addr)) == 0
                                        && ntohs (((struct sockaddr_in6 *) 
&data_dest)->sin6_port)
-                                          > IPPORT_RESERVED
+                                          > IPPORT_RESERVED)
                                       )
                                   )
                                {
@@ -730,19 +730,19 @@ cmd
                        if ($2)
                          {
                            if ($4 &&
-                               ( his_addr.ss_family == AF_INET
+                               ((his_addr.ss_family == AF_INET
                                  && memcmp (&((struct sockaddr_in *) 
&his_addr)->sin_addr,
                                             &((struct sockaddr_in *) 
&data_dest)->sin_addr,
                                             sizeof (struct in_addr)) == 0
                                  && ntohs (((struct sockaddr_in *) 
&data_dest)->sin_port)
-                                       > IPPORT_RESERVED
-                                 ||
-                                 his_addr.ss_family == AF_INET6
+                                       > IPPORT_RESERVED)
+                                ||
+                                (his_addr.ss_family == AF_INET6
                                  && memcmp (&((struct sockaddr_in6 *) 
&his_addr)->sin6_addr,
                                             &((struct sockaddr_in6 *) 
&data_dest)->sin6_addr,
                                             sizeof (struct in6_addr)) == 0
                                  && ntohs (((struct sockaddr_in6 *) 
&data_dest)->sin6_port)
-                                       > IPPORT_RESERVED
+                                       > IPPORT_RESERVED)
                                )
                               )
                              {
diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
index c73bb7c..d796fc0 100644
--- a/ftpd/ftpd.c
+++ b/ftpd/ftpd.c
@@ -191,7 +191,7 @@ off_to_str (off_t off)
   if (sizeof (off) > sizeof (long))
     sprintf (*next_buf, "%lld", (long long int) off);
   else if (sizeof (off) == sizeof (long))
-    sprintf (*next_buf, "%ld", off);
+    sprintf (*next_buf, "%ld", (long) off);
   else
     sprintf (*next_buf, "%d", (int) off);
 
@@ -316,7 +316,7 @@ static struct argp_option options[] = {
     "",
     GRID+3 },
 #endif
-  { NULL }
+  { NULL, 0, NULL, 0, NULL, 0 }
 };
 
 static error_t
@@ -441,7 +441,9 @@ main (int argc, char *argv[], char **envp)
 #ifdef HAVE_INITSETPROCTITLE
   /* Save start and extent of argv for setproctitle.  */
   initsetproctitle (argc, argv, envp);
-#endif /* HAVE_INITSETPROCTITLE */
+#else /* !HAVE_INITSETPROCTITLE */
+  (void) envp;         /* Silence warnings.  */
+#endif
 
   /* Parse the command line */
   iu_argp_init ("ftpd", default_program_authors);
diff --git a/ftpd/pam.c b/ftpd/pam.c
index 41973ce..6f4fe00 100644
--- a/ftpd/pam.c
+++ b/ftpd/pam.c
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <syslog.h>
+#include <unused-parameter.h>
 #include "extern.h"
 
 #ifdef HAVE_SECURITY_PAM_APPL_H
@@ -255,7 +256,7 @@ pam_pass (const char *passwd, struct credentials *pcred)
   int error = PAM_AUTH_ERR;
   if (pamh)
     {
-      pcred->pass = passwd;
+      pcred->pass = (char *) passwd;
       error = pam_doit (pcred);
       pcred->pass = NULL;
     }
@@ -263,7 +264,7 @@ pam_pass (const char *passwd, struct credentials *pcred)
 }
 
 void
-pam_end_login (struct credentials * pcred)
+pam_end_login (struct credentials * pcred _GL_UNUSED_PARAMETER)
 {
   int error;
 
diff --git a/ftpd/popen.c b/ftpd/popen.c
index 83b9dc0..8aa8a11 100644
--- a/ftpd/popen.c
+++ b/ftpd/popen.c
@@ -86,7 +86,9 @@ struct file_pid
 /* A linked list associating ftpd_popen'd FILEs with pids.  */
 struct file_pid *file_pids = 0;
 
+#ifdef WITH_LIBLS
 extern int ls_main (int argc, char *argv[]);
+#endif
 
 FILE *
 ftpd_popen (char *program, const char *type)
diff --git a/ftpd/server_mode.c b/ftpd/server_mode.c
index 0a48773..7b7771e 100644
--- a/ftpd/server_mode.c
+++ b/ftpd/server_mode.c
@@ -234,6 +234,8 @@ server_mode (const char *pidfile, struct sockaddr 
*phis_addr,
 
 #ifndef HAVE_FORK
   _exit (execvp (argv[0], argv));
+#else
+  (void) argv;         /* Silence warnings.  */
 #endif
 
   return fd;
diff --git a/libls/fts.c b/libls/fts.c
index b9736f4..35d0de4 100644
--- a/libls/fts.c
+++ b/libls/fts.c
@@ -55,6 +55,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <unused-parameter.h>
 
 #include "fts.h"
 
@@ -512,7 +513,7 @@ next:tmp = p;
  * reasons.
  */
 int
-fts_set (FTS *sp, FTSENT *p, int instr)
+fts_set (FTS *sp _GL_UNUSED_PARAMETER, FTSENT *p, int instr)
 {
   if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
       instr != FTS_NOINSTR && instr != FTS_SKIP)
diff --git a/libls/ls.c b/libls/ls.c
index f331819..481f76f 100644
--- a/libls/ls.c
+++ b/libls/ls.c
@@ -494,7 +494,7 @@ display (FTSENT *p, FTSENT *list)
            maxinode = sp->st_ino;
          if (sp->st_nlink > maxnlink)
            maxnlink = sp->st_nlink;
-         if (sp->st_size > maxsize)
+         if (sp->st_size > (off_t) maxsize)
            maxsize = sp->st_size;
 
          btotal += sp->st_blocks;

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=64d135fa07aff893864faadf5ca8014c8389f6b2


commit 64d135fa07aff893864faadf5ca8014c8389f6b2
Author: Mats Erik Andersson <address@hidden>
Date:   Mon Sep 10 19:56:23 2012 +0200

    ping, ping6: Compiler warnings.

diff --git a/ChangeLog b/ChangeLog
index ebb85ce..5496d5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-09-10  Mats Erik Andersson  <address@hidden>
+
+       * ping/ping.c (ping_finish): Replace format string "%ld"
+       by "%zu" for counter status.
+       * ping/ping6.c (ping_finish): Likewise.
+       * ping/ping_common.h (struct ping_data): Set type size_t
+       on fields ping_num_xmit, ping_num_recv and ping_num_rept.
+       * ping/ping_router.c: Include <unused-parameter.h>.
+       (ping_router): Add _GL_UNUSED_PARAMETER.
+
 2012-09-07  Mats Erik Andersson  <address@hidden>
 
        talk, talkd: Portability issue.
diff --git a/ping/ping.c b/ping/ping.c
index 0c3de3d..9f51671 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -517,14 +517,14 @@ ping_finish (void)
 {
   fflush (stdout);
   printf ("--- %s ping statistics ---\n", ping->ping_hostname);
-  printf ("%ld packets transmitted, ", ping->ping_num_xmit);
-  printf ("%ld packets received, ", ping->ping_num_recv);
+  printf ("%zu packets transmitted, ", ping->ping_num_xmit);
+  printf ("%zu packets received, ", ping->ping_num_recv);
   if (ping->ping_num_rept)
-    printf ("+%ld duplicates, ", ping->ping_num_rept);
+    printf ("+%zu duplicates, ", ping->ping_num_rept);
   if (ping->ping_num_xmit)
     {
       if (ping->ping_num_recv > ping->ping_num_xmit)
-       printf ("-- somebody's printing up packets!");
+       printf ("-- somebody is printing forged packets!");
       else
        printf ("%d%% packet loss",
                (int) (((ping->ping_num_xmit - ping->ping_num_recv) * 100) /
diff --git a/ping/ping6.c b/ping/ping6.c
index e8f895e..5364a99 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -404,10 +404,10 @@ ping_finish (void)
 {
   fflush (stdout);
   printf ("--- %s ping statistics ---\n", ping->ping_hostname);
-  printf ("%ld packets transmitted, ", ping->ping_num_xmit);
-  printf ("%ld packets received, ", ping->ping_num_recv);
+  printf ("%zu packets transmitted, ", ping->ping_num_xmit);
+  printf ("%zu packets received, ", ping->ping_num_recv);
   if (ping->ping_num_rept)
-    printf ("+%ld duplicates, ", ping->ping_num_rept);
+    printf ("+%zu duplicates, ", ping->ping_num_rept);
   if (ping->ping_num_xmit)
     {
       if (ping->ping_num_recv > ping->ping_num_xmit)
diff --git a/ping/ping_common.h b/ping/ping_common.h
index 5cf3e8c..0a5c336 100644
--- a/ping/ping_common.h
+++ b/ping/ping_common.h
@@ -117,9 +117,9 @@ struct ping_data
 
   unsigned char *ping_buffer;         /* I/O buffer */
   union ping_address ping_from;
-  long ping_num_xmit;          /* Number of packets transmitted */
-  long ping_num_recv;          /* Number of packets received */
-  long ping_num_rept;          /* Number of duplicates received */
+  size_t ping_num_xmit;        /* Number of packets transmitted */
+  size_t ping_num_recv;        /* Number of packets received */
+  size_t ping_num_rept;        /* Number of duplicates received */
 };
 
 #define _C_BIT(p,bit)   (p)->ping_cktab[(bit)>>3]      /* byte in ck array */
diff --git a/ping/ping_router.c b/ping/ping_router.c
index e478ffa..0d8f3d8 100644
--- a/ping/ping_router.c
+++ b/ping/ping_router.c
@@ -39,12 +39,13 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
+#include <unused-parameter.h>
 
 #include <ping.h>
 #include <ping_impl.h>
 
 int
-ping_router (char *hostname)
+ping_router (char *hostname _GL_UNUSED_PARAMETER)
 {
   return 0;
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |   67 ++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac             |   35 ++++++++++++++++-------
 ftpd/Makefile.am         |    2 +-
 ftpd/ftpcmd.y            |   18 ++++++------
 ftpd/ftpd.c              |    8 +++--
 ftpd/pam.c               |    5 ++-
 ftpd/popen.c             |    2 +
 ftpd/server_mode.c       |    2 +
 ifconfig/changeif.c      |   41 +++++++++++++++++++++++++++-
 libinetutils/localhost.c |   35 ++++++++++++++++++++---
 libls/fts.c              |    3 +-
 libls/ls.c               |    2 +-
 ping/ping.c              |    8 +++---
 ping/ping6.c             |    6 ++--
 ping/ping_common.h       |    6 ++--
 ping/ping_router.c       |    3 +-
 src/Makefile.am          |    4 +-
 tests/Makefile.am        |    2 +-
 18 files changed, 201 insertions(+), 48 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]