Supress warnings. Correct spelling.
authorMartin Johansson <martin@fatbob.nu>
Mon, 11 Feb 2013 21:48:28 +0000 (22:48 +0100)
committerMartin Johansson <martin@fatbob.nu>
Mon, 11 Feb 2013 21:48:28 +0000 (22:48 +0100)
src/ban.c
src/main.c
src/ssl.c

index f69ccf009eba3f71408f69b61d1bae0b9524aeba..ae600ffa382ac4014312e14b0c99e3bfc9091285 100644 (file)
--- a/src/ban.c
+++ b/src/ban.c
@@ -253,8 +253,8 @@ static void Ban_saveBanFile(void)
        list_iterate(itr, &banlist) {
                ban = list_get_entry(itr, ban_t, node);
                SSLi_hash2hex(ban->hash, hexhash);
-               fprintf(file, "%s,%s,%d,%d,%d,%s,%s\n", hexhash, inet_ntoa(*((struct in_addr *)&ban->address)),
-                       ban->mask, ban->time, ban->duration, ban->name, ban->reason);
+               fprintf(file, "%s,%s,%d,%ld,%d,%s,%s\n", hexhash, inet_ntoa(*((struct in_addr *)&ban->address)),
+                       ban->mask, (long int)ban->time, ban->duration, ban->name, ban->reason);
        }
        fclose(file);
        banlist_changed = false;
index 215049fedc08c1a16f4d81166389de9598d9d6ec..344f6bd88af326437ac54cda453294293ff6f487 100644 (file)
@@ -89,7 +89,7 @@ void lockfile(const char *pidfile)
        }
 
        snprintf(str,16,"%d\n", getpid());
-       write(lfp, str, strlen(str)); /* record pid to lockfile */
+       (void)write(lfp, str, strlen(str)); /* record pid to lockfile */
        Log_info("PID-file: %s", pidfile);
 
        /* If uMurmur ever starts to fork()+exec(), we don't want it to
@@ -195,11 +195,11 @@ void daemonize()
                close(i); /* close all descriptors */
        
        i = open("/dev/null",O_RDWR);
-       dup(i);
-       dup(i);
+       (void)dup(i);
+       (void)dup(i);
        
        umask(027); /* set newly created file permissions */
-       chdir("/");
+       (void)chdir("/");
                
 }
 
index e7a53a21d55810354c48d814a52ed58472033a10..d337e443c26875f0cb41e48acda3e02a8cc83b71 100644 (file)
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -173,7 +173,7 @@ void SSLi_deinit(void)
 /* Create SHA1 of last certificate in the peer's chain. */
 bool_t SSLi_getSHA1Hash(SSL_handle_t *ssl, uint8_t *hash)
 {
-       x509_cert *cert;
+       x509_cert const *cert;
 #ifdef POLARSSL_API_V1_2
        cert = ssl_get_peer_cert(ssl);
 #else
@@ -201,7 +201,7 @@ SSL_handle_t *SSLi_newconnection(int *fd, bool_t *SSLready)
        
        rc = ssl_init(ssl);
        if (rc != 0 )
-               Log_fatal("Failed to initalize: %d", rc);
+               Log_fatal("Failed to initialize: %d", rc);
        
        ssl_set_endpoint(ssl, SSL_IS_SERVER);   
        ssl_set_authmode(ssl, SSL_VERIFY_OPTIONAL);