]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2757] Quiet compiler warnings
authorHarlan Stenn <stenn@ntp.org>
Sat, 21 Feb 2015 10:35:38 +0000 (10:35 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sat, 21 Feb 2015 10:35:38 +0000 (10:35 +0000)
bk: 54e85f7afd-U0LXK_qKlY0qAKYcGwQ

ChangeLog
lib/isc/result.c
lib/isc/unix/file.c
lib/isc/unix/ifiter_ioctl.c
lib/isc/unix/net.c
libntp/work_fork.c
ntpd/ntp_crypto.c

index 99784228bf945f406877c084b63d9b9566b4eed0..9e517dcc54c5df39439773053a092df09eb8abf4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
 * [Bug 2728] See if C99-style structure initialization works.
 * [Bug 2747] Upgrade libevent to 2.1.5-beta.
 * [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. .
+* [Bug 2757] Quiet compiler warnings.
 ---
 (4.2.8p1) 2015/02/04 Released by Harlan Stenn <stenn@ntp.org>
 
index 520f1613acd17329c2fca39f451e836559154783..da57272dfc2714ce0bf071016b30fb6a510004fd 100644 (file)
@@ -172,7 +172,7 @@ const char *
 isc_result_totext(isc_result_t result) {
        resulttable *table;
        const char *txt, *default_text;
-       int index;
+       int idx;
 
        initialize();
 
@@ -183,15 +183,15 @@ isc_result_totext(isc_result_t result) {
             table != NULL;
             table = ISC_LIST_NEXT(table, link)) {
                if (result >= table->base && result <= table->last) {
-                       index = (int)(result - table->base);
-                       default_text = table->text[index];
+                       idx = (int)(result - table->base);
+                       default_text = table->text[idx];
                        /*
-                        * Note: we use 'index + 1' as the message number
-                        * instead of index because isc_msgcat_get() requires
+                        * Note: we use 'idx + 1' as the message number
+                        * instead of idx because isc_msgcat_get() requires
                         * the message number to be > 0.
                         */
                        txt = isc_msgcat_get(table->msgcat, table->set,
-                                            index + 1, default_text);
+                                            idx + 1, default_text);
                        break;
                }
        }
index 3b59e86b075555fd3b5db72d8eea61ca0f6d75e1..9eda4a33bc8060954f31f4e304f81239640ec2ad 100644 (file)
@@ -508,7 +508,7 @@ isc_file_safecreate(const char *filename, FILE **fp) {
 }
 
 isc_result_t
-isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
+isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirnam, char **basenam)
 {
        char *dir, *file, *slash;
 
@@ -537,8 +537,8 @@ isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
                return (ISC_R_INVALIDFILE);
        }
 
-       *dirname = dir;
-       *basename = file;
+       *dirnam = dir;
+       *basenam = file;
 
        return (ISC_R_SUCCESS);
 }
index a684867ce71f9a81606953720e16e89e321ce462..f9a3affe6fd9d8415de2ea88dd5508f040b5df82 100644 (file)
@@ -109,6 +109,10 @@ struct isc_interfaceiter {
 #endif
 #endif
 
+/* Silence a warning when this file is #included */
+int
+isc_ioctl(int fildes, int req, char *arg);
+
 int
 isc_ioctl(int fildes, int req, char *arg) {
        int trys;
index 2ba17d165067c6b0a1ffe153a91ca3e5de837594..7056668ca0cd4e38605aa5bef69923cd72f169d7 100644 (file)
@@ -106,7 +106,8 @@ const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT;
 static isc_once_t      once_ipv6only = ISC_ONCE_INIT;
 # endif
 
-# if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
+# if defined(ISC_PLATFORM_HAVEIPV6) && \
+     defined(WANT_IPV6) && defined(ISC_PLATFORM_HAVEIN6PKTINFO)
 static isc_once_t      once_ipv6pktinfo = ISC_ONCE_INIT;
 # endif
 #endif /* ISC_PLATFORM_HAVEIPV6 */
index 10329e70be8f4fc11e5c3430511e8a08a6481298..dab02bc6af1484180fab997ef0c93c464f20a412 100644 (file)
@@ -382,7 +382,7 @@ fork_blocking_child(
        int             rc;
        int             was_pipe;
        int             is_pipe;
-       int             saved_errno;
+       int             saved_errno = 0;
        int             childpid;
        int             keep_fd;
        int             fd;
index 089dc6f2887d9cb292c8e9595af95bd9faa8b5d4..5795ae8dfdd799f7b0e9a4934c22deb8b6b355ac 100644 (file)
@@ -1731,7 +1731,7 @@ crypto_args(
        tstamp_t tstamp;        /* NTP timestamp */
        struct exten *ep;       /* extension field pointer */
        u_int   len;            /* extension field length */
-       size_t  slen;
+       size_t  slen = 0;
 
        tstamp = crypto_time();
        len = sizeof(struct exten);