summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaƫl PORTAY <gael.portay@savoirfairelinux.com>2017-04-26 11:48:51 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2017-05-15 22:02:33 -0400
commite8498bbfcc9141c0287745488a5a08b1ff33290a (patch)
treecb89c7f327811538c06780745ba41dbc8f2953af
parent7a27d5eff5ca1e49446e7088ca05a6492dd6d204 (diff)
downloadlighttpd1.4-e8498bbfcc9141c0287745488a5a08b1ff33290a.tar.gz
lighttpd1.4-e8498bbfcc9141c0287745488a5a08b1ff33290a.zip
[core] silence compiler warnings if !HAVE_FORK
silence compiler warnings if HAVE_FORK is not set However, if HAVE_FORK is not set, then -Werror was probably passed to ./configure, which is currently a mistake. lighttpd can successfully compiles src/ with -Werror on many platforms, but ./configure tests should not be run with -Werror. [gstrauss] github: closes #81 x-ref: "Fix warnings" https://github.com/lighttpd/lighttpd1.4/pull/81
-rw-r--r--src/mod_fastcgi.c4
-rw-r--r--src/mod_rrdtool.c5
-rw-r--r--src/mod_scgi.c4
-rw-r--r--src/mod_webdav.c1
-rw-r--r--src/server.c2
-rw-r--r--src/stat_cache.c3
6 files changed, 17 insertions, 2 deletions
diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c
index dcece3c4..e348a8fa 100644
--- a/src/mod_fastcgi.c
+++ b/src/mod_fastcgi.c
@@ -348,6 +348,7 @@ typedef struct {
/* ok, we need a prototype */
static handler_t fcgi_handle_fdevent(server *srv, void *ctx, int revents);
+#ifdef HAVE_FORK
static void reset_signals(void) {
#ifdef SIGTTOU
signal(SIGTTOU, SIG_DFL);
@@ -362,6 +363,7 @@ static void reset_signals(void) {
signal(SIGPIPE, SIG_DFL);
signal(SIGUSR1, SIG_DFL);
}
+#endif /* HAVE_FORK */
static void fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
@@ -824,6 +826,7 @@ FREE_FUNC(mod_fastcgi_free) {
return HANDLER_GO_ON;
}
+#ifdef HAVE_FORK
static int env_add(char_array *env, const char *key, size_t key_len, const char *val, size_t val_len) {
char *dst;
size_t i;
@@ -913,6 +916,7 @@ static int parse_binpath(char_array *env, buffer *b) {
return 0;
}
+#endif /* HAVE_FORK */
#if !defined(HAVE_FORK)
static int fcgi_spawn_connection(server *srv,
diff --git a/src/mod_rrdtool.c b/src/mod_rrdtool.c
index d9c26b70..2f1b8f79 100644
--- a/src/mod_rrdtool.c
+++ b/src/mod_rrdtool.c
@@ -79,12 +79,11 @@ FREE_FUNC(mod_rrd_free) {
free(p->config_storage);
if (p->rrdtool_pid) {
- int status;
close(p->read_fd);
close(p->write_fd);
#ifdef HAVE_FORK
/* collect status */
- while (-1 == waitpid(p->rrdtool_pid, &status, 0) && errno == EINTR) ;
+ while (-1 == waitpid(p->rrdtool_pid, NULL, 0) && errno == EINTR) ;
#endif
}
@@ -181,6 +180,8 @@ static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
return 0;
#else
+ UNUSED(srv);
+ UNUSED(p);
return -1;
#endif
}
diff --git a/src/mod_scgi.c b/src/mod_scgi.c
index 40b99e86..3ca9d58a 100644
--- a/src/mod_scgi.c
+++ b/src/mod_scgi.c
@@ -327,6 +327,7 @@ static handler_t scgi_handle_fdevent(server *srv, void *ctx, int revents);
int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *proc);
+#ifdef HAVE_FORK
static void reset_signals(void) {
#ifdef SIGTTOU
signal(SIGTTOU, SIG_DFL);
@@ -341,6 +342,7 @@ static void reset_signals(void) {
signal(SIGPIPE, SIG_DFL);
signal(SIGUSR1, SIG_DFL);
}
+#endif /* HAVE_FORK */
static handler_ctx * handler_ctx_init(void) {
handler_ctx * hctx;
@@ -647,6 +649,7 @@ FREE_FUNC(mod_scgi_free) {
return HANDLER_GO_ON;
}
+#ifdef HAVE_FORK
static int env_add(char_array *env, const char *key, size_t key_len, const char *val, size_t val_len) {
char *dst;
size_t i;
@@ -683,6 +686,7 @@ static int env_add(char_array *env, const char *key, size_t key_len, const char
return 0;
}
+#endif /* HAVE_FORK */
#if !defined(HAVE_FORK)
static int scgi_spawn_connection(server *srv,
diff --git a/src/mod_webdav.c b/src/mod_webdav.c
index d575ade8..804f0da2 100644
--- a/src/mod_webdav.c
+++ b/src/mod_webdav.c
@@ -14,6 +14,7 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
diff --git a/src/server.c b/src/server.c
index acb7c7af..277325b8 100644
--- a/src/server.c
+++ b/src/server.c
@@ -837,7 +837,9 @@ static int server_main (server * const srv, int argc, char **argv) {
int test_config = 0;
int i_am_root = 0;
int o;
+#ifdef HAVE_FORK
int num_childs = 0;
+#endif
int fd;
size_t i;
time_t idle_limit = 0, last_active_ts = time(NULL);
diff --git a/src/stat_cache.c b/src/stat_cache.c
index 882ba6d4..796050dd 100644
--- a/src/stat_cache.c
+++ b/src/stat_cache.c
@@ -107,10 +107,13 @@ typedef struct stat_cache {
buffer *hash_key; /* temp-store for the hash-key */
} stat_cache;
+#ifdef HAVE_FAM_H
static handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent);
+#endif
stat_cache *stat_cache_init(server *srv) {
stat_cache *sc = NULL;
+ UNUSED(srv);
sc = calloc(1, sizeof(*sc));
force_assert(NULL != sc);