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_8-114-g8cd0ff9


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-114-g8cd0ff9
Date: Sat, 20 Aug 2011 13:37:17 +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  8cd0ff9e38fd76117028a983322be0e0d037d1d5 (commit)
       via  6c1d6239142eaee4e4cd39f2f7511f5f8c38e23a (commit)
      from  de6d5ba5cf6cd3757ff08e62aaeb2e301d634dcd (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=8cd0ff9e38fd76117028a983322be0e0d037d1d5


commit 8cd0ff9e38fd76117028a983322be0e0d037d1d5
Author: Mats Erik Andersson <address@hidden>
Date:   Sat Aug 20 14:44:26 2011 +0200

    syslogd,logger: Portability of macros and names.

diff --git a/ChangeLog b/ChangeLog
index 1485603..758c000 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-08-20  Mats Erik Andersson <address@hidden>
 
+       * src/logger.c (send_to_syslog, parse_opt) [LOG_PERROR]: Enclose every
+       reference to LOG_PERROR in a compiler conditional.
+       * src/logprio.h: New file.
+       * src/logger.c [!HAVE_SYSLOG_INTERNAL]: Include "logprio.h" instead of
+       the irregularly present <syslog-int.h>.
+       * src/syslogd.c: Likewise.
+
+2011-08-20  Mats Erik Andersson <address@hidden>
+
        * ftp/ftp.c (hookup): Remove length in format string.
        * ifconfig/printif.c [HAVE_ALLOCA_H]: Include <alloca.h>.
        * src/rexec.c: Include "minmax.h".
diff --git a/src/logger.c b/src/logger.c
index 86e7523..d607c58 100644
--- a/src/logger.c
+++ b/src/logger.c
@@ -44,7 +44,7 @@
 #define SYSLOG_NAMES
 #include <syslog.h>
 #ifndef HAVE_SYSLOG_INTERNAL
-# include <syslog-int.h>
+# include "logprio.h"
 #endif
 
 #define MAKE_PRI(fac,pri) (((fac) & LOG_FACMASK) | ((pri) & LOG_PRIMASK))
@@ -341,6 +341,7 @@ send_to_syslog (const char *msg)
     error (EXIT_FAILURE, errno, "cannot format message");
   len = strlen (pbuf);
 
+#ifdef LOG_PERROR
   if (logflags & LOG_PERROR)
     {
       struct iovec iov[2], *ioptr;
@@ -359,6 +360,7 @@ send_to_syslog (const char *msg)
        }
       writev (fileno (stderr), iov, ioptr - iov + 1);
     }
+#endif /* LOG_PERROR */
 
   rc = send (fd, pbuf, len, 0);
   free (pbuf);
@@ -433,9 +435,11 @@ parse_opt (int key, char *arg, struct argp_state *state)
        }
       break;
 
+#ifdef LOG_PERROR
     case 's':
       logflags |= LOG_PERROR;
       break;
+#endif /* LOG_PERROR */
 
     case 'f':
       if (strcmp (arg, "-") && freopen (arg, "r", stdin) == NULL)
diff --git a/src/logprio.h b/src/logprio.h
new file mode 100644
index 0000000..5680749
--- /dev/null
+++ b/src/logprio.h
@@ -0,0 +1,141 @@
+/*
+  Copyright (C) 2011 Free Software Foundation, Inc.
+
+  This file is part of GNU Inetutils.
+
+  GNU Inetutils is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or (at
+  your option) any later version.
+
+  GNU Inetutils is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see `http://www.gnu.org/licenses/'.
+ */
+
+/*
+ * Copyright (c) 1982, 1986, 1988, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+  Separate tables of facility names and priority names.
+  These are not always present in the headers of known
+  library implementations.  They are brought in as needed.
+ */
+
+#ifndef _IU_LOGPRIO_H
+#  define _IU_LOGPRIO_H        1
+
+typedef struct _code {
+       char    *c_name;
+       int     c_val;
+} CODE;
+
+/* Insert any missing macros.  */
+
+#ifndef LOG_PRI
+#  define LOG_PRI(p)   ((p) & LOG_PRIMASK)
+#endif
+
+#ifndef LOG_MAKEPRI
+#  define LOG_MAKEPRI(fac, p)  (((fac) << 3) | (p))
+#endif
+
+#ifndef INTERNAL_NOPRI
+#  define INTERNAL_NOPRI 0x10  /* the "no priority" priority */
+#endif
+
+#ifndef INTERNAL_MARK  /* mark "facility", first unused value */
+#  define INTERNAL_MARK        LOG_MAKEPRI(LOG_NFACILITIES, 0)
+#endif
+
+#ifndef LOG_FACMASK
+#  define LOG_FACMASK  0x03f8
+#endif
+
+#ifndef LOG_FAC
+#  define LOG_FAC(p)   (((p) & LOG_FACMASK) >> 3)
+#endif
+
+/* OpenSolaris needs the next two.  */
+#ifndef LOG_FTP
+#  define LOG_FTP      (11 << 3)       /* A guess */
+#endif
+
+#ifndef LOG_AUTHPRIV
+#  define LOG_AUTHPRIV LOG_AUTH
+#endif
+
+CODE prioritynames[] =
+  {
+    { "alert", LOG_ALERT },
+    { "crit", LOG_CRIT },
+    { "debug", LOG_DEBUG },
+    { "emerg", LOG_EMERG },
+    { "err", LOG_ERR },
+    { "error", LOG_ERR },              /* DEPRECATED */
+    { "info", LOG_INFO },
+    { "none", INTERNAL_NOPRI },                /* INTERNAL */
+    { "notice", LOG_NOTICE },
+    { "panic", LOG_EMERG },            /* DEPRECATED */
+    { "warn", LOG_WARNING },           /* DEPRECATED */
+    { "warning", LOG_WARNING },
+    { NULL, -1 }
+  };
+
+CODE facilitynames[] =
+  {
+    { "auth", LOG_AUTH },
+    { "authpriv", LOG_AUTHPRIV },
+    { "cron", LOG_CRON },
+    { "daemon", LOG_DAEMON },
+    { "ftp", LOG_FTP },
+    { "kern", LOG_KERN },
+    { "lpr", LOG_LPR },
+    { "mail", LOG_MAIL },
+    { "mark", INTERNAL_MARK },         /* INTERNAL */
+    { "news", LOG_NEWS },
+    { "security", LOG_AUTH },          /* DEPRECATED */
+    { "syslog", LOG_SYSLOG },
+    { "user", LOG_USER },
+    { "uucp", LOG_UUCP },
+    { "local0", LOG_LOCAL0 },
+    { "local1", LOG_LOCAL1 },
+    { "local2", LOG_LOCAL2 },
+    { "local3", LOG_LOCAL3 },
+    { "local4", LOG_LOCAL4 },
+    { "local5", LOG_LOCAL5 },
+    { "local6", LOG_LOCAL6 },
+    { "local7", LOG_LOCAL7 },
+    { NULL, -1 }
+  };
+#endif /* _IU_LOGPRIO_H */
diff --git a/src/syslogd.c b/src/syslogd.c
index a09586c..f8758c2 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -113,7 +113,7 @@
 #define SYSLOG_NAMES
 #include <syslog.h>
 #ifndef HAVE_SYSLOG_INTERNAL
-# include <syslog-int.h>
+# include "logprio.h"
 #endif
 
 #include <error.h>

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


commit 6c1d6239142eaee4e4cd39f2f7511f5f8c38e23a
Author: Mats Erik Andersson <address@hidden>
Date:   Sat Aug 20 04:59:40 2011 +0200

    Minor portability issues found by OpenSolaris.

diff --git a/ChangeLog b/ChangeLog
index b71a316..1485603 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-08-20  Mats Erik Andersson <address@hidden>
+
+       * ftp/ftp.c (hookup): Remove length in format string.
+       * ifconfig/printif.c [HAVE_ALLOCA_H]: Include <alloca.h>.
+       * src/rexec.c: Include "minmax.h".
+       * libls/fts.c (fts_load): Replace `rindex' with `strrchr'.
+       * ping/ping_echo.c (ping_echo): Write non-empty error text.
+       * ping/ping6.c (parse_opt,ping_init): Likewise.
+       * ping/ping6.c [__sun__]: Define _XPG4_2 for access to `msg_control'.
+
 2011-08-18  Mats Erik Andersson <address@hidden>
 
        * libinetutils/utmp_logout.c (utmp_logout) [UTMPX]: Insert missing
diff --git a/ftp/ftp.c b/ftp/ftp.c
index 89efaf1..c8de52c 100644
--- a/ftp/ftp.c
+++ b/ftp/ftp.c
@@ -129,7 +129,7 @@ hookup (char *host, int port)
   socklen_t len;
   static char hostnamebuf[80];
 
-  snprintf (portstr, sizeof (portstr) - 1, "%8u", port);
+  snprintf (portstr, sizeof (portstr) - 1, "%u", port);
   memset (&hisctladdr, 0, sizeof (hisctladdr));
   memset (&hints, 0, sizeof (hints));
 
diff --git a/ifconfig/printif.c b/ifconfig/printif.c
index 7150869..e87b803 100644
--- a/ifconfig/printif.c
+++ b/ifconfig/printif.c
@@ -37,6 +37,10 @@
 # endif
 #endif
 
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
+
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/socket.h>
diff --git a/libls/fts.c b/libls/fts.c
index 6e533f1..80e8abf 100644
--- a/libls/fts.c
+++ b/libls/fts.c
@@ -224,7 +224,7 @@ fts_load (FTS *sp, register FTSENT *p)
    */
   len = p->fts_pathlen = p->fts_namelen;
   memmove (sp->fts_path, p->fts_name, len + 1);
-  if ((cp = rindex (p->fts_name, '/')) && (cp != p->fts_name || cp[1]))
+  if ((cp = strrchr (p->fts_name, '/')) && (cp != p->fts_name || cp[1]))
     {
       len = strlen (++cp);
       memmove (p->fts_name, cp, len + 1);
diff --git a/ping/ping6.c b/ping/ping6.c
index 2fcc9a4..fd89537 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -19,6 +19,10 @@
 
 #include <config.h>
 
+#ifdef __sun__
+#  define _XPG4_2      1       /* OpenSolaris: msg_control */
+#endif /* __sun__ */
+
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/uio.h>
@@ -112,7 +116,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
 
     case 'f':
       if (!is_root)
-        error (EXIT_FAILURE, errno, NULL);
+        error (EXIT_FAILURE, 0, "flooding needs root privilege");
 
       options |= OPT_FLOOD;
       setbuf (stdout, (char *) NULL);
@@ -125,11 +129,11 @@ parse_opt (int key, char *arg, struct argp_state *state)
 
     case 'l':
       if (!is_root)
-        error (EXIT_FAILURE, errno, NULL);
+        error (EXIT_FAILURE, 0, "preloading needs root privilege");
 
       preload = strtoul (arg, &endptr, 0);
       if (*endptr || preload > INT_MAX)
-        error (EXIT_FAILURE, errno, NULL);
+        error (EXIT_FAILURE, 0, "preload size too large");
 
       break;
 
@@ -706,7 +710,7 @@ ping_init (int type, int ident)
   if (fd < 0)
     {
       if (errno == EPERM || errno == EACCES)
-        error (EXIT_FAILURE, errno, NULL);
+        error (EXIT_FAILURE, errno, "raw socket");
 
       return NULL;
     }
diff --git a/ping/ping_echo.c b/ping/ping_echo.c
index a5a2b19..33680f2 100644
--- a/ping/ping_echo.c
+++ b/ping/ping_echo.c
@@ -94,7 +94,7 @@ ping_echo (char *hostname)
       rspace[IPOPT_OFFSET] = IPOPT_MINOFF;
       if (setsockopt (ping->ping_fd, IPPROTO_IP,
                      IP_OPTIONS, rspace, sizeof (rspace)) < 0)
-        error (EXIT_FAILURE, errno, NULL);
+        error (EXIT_FAILURE, errno, "setsockopt");
 #else
       error (EXIT_FAILURE, 0, "record route not available in this "
              "implementation.");
diff --git a/src/rexec.c b/src/rexec.c
index f0e421a..8d28fe5 100644
--- a/src/rexec.c
+++ b/src/rexec.c
@@ -45,6 +45,7 @@
 #include <argp.h>
 #include <error.h>
 #include "libinetutils.h"
+#include "minmax.h"
 
 #define MAX3(a, b, c) (MAX (MAX (a, b), c))
 

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

Summary of changes:
 ChangeLog          |   19 +++++++
 ftp/ftp.c          |    2 +-
 ifconfig/printif.c |    4 ++
 libls/fts.c        |    2 +-
 ping/ping6.c       |   12 +++--
 ping/ping_echo.c   |    2 +-
 src/logger.c       |    6 ++-
 src/logprio.h      |  141 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/rexec.c        |    1 +
 src/syslogd.c      |    2 +-
 10 files changed, 182 insertions(+), 9 deletions(-)
 create mode 100644 src/logprio.h


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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