fix compiler warnings

This commit is contained in:
Moritz Warning
2019-09-21 20:40:27 +02:00
parent 55628d10f8
commit 3badcecc26
3 changed files with 2 additions and 5 deletions

View File

@@ -684,7 +684,7 @@ config_read(const char *filename)
char lockfile[] = "/tmp/ndsctl.lock";
//Remove ndsctl lock file if it exists
if (fd = fopen(lockfile, "r")) {
if ((fd = fopen(lockfile, "r")) != NULL) {
fclose(fd);
remove(lockfile);
}

View File

@@ -92,8 +92,6 @@ static int do_binauth(struct MHD_Connection *connection, const char *binauth, t_
int download;
int rc;
s_config *config = config_get_config();
MHD_get_connection_values(connection, MHD_HEADER_KIND, get_user_agent_callback, &user_agent);
debug(LOG_INFO, "BinAuth: User Agent is [ %s ]", user_agent);
@@ -825,7 +823,6 @@ static int redirect_to_splashpage(struct MHD_Connection *connection, t_client *c
int ret = 0;
const char *separator = "&";
char *querystr = query_str;
s_config *config = config_get_config();
get_query(connection, &query, separator);
if (!query) {

View File

@@ -168,7 +168,7 @@ ndsctl_do(const char *socket, const struct argument *arg, const char *param)
setlogmask(LOG_UPTO (LOG_NOTICE));
if (fd = fopen(lockfile, "r")) {
if ((fd = fopen(lockfile, "r")) != NULL) {
openlog ("ndsctl", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
syslog (LOG_NOTICE, "ndsctl is locked by another process - try again later...");
closelog ();