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;
}
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
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("/");
}
/* 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
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);