aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-06-06 10:04:06 +0300
committerSergey Poznyakoff <gray@gnu.org>2018-06-06 10:04:06 +0300
commitdd17a268c9f5163c6cfcfe35efa60b2d32b02f8d (patch)
treec8e4aace7f752b5711d31a57a7bfbfa077b58641
parentfa7d6111503159af4aa96c0517d0e9774adf6791 (diff)
downloadtallyman-dd17a268c9f5163c6cfcfe35efa60b2d32b02f8d.tar.gz
tallyman-dd17a268c9f5163c6cfcfe35efa60b2d32b02f8d.tar.bz2
Reorganize includes
-rw-r--r--src/config.c5
-rw-r--r--src/pidfile.c3
-rw-r--r--src/remoteip.c5
-rw-r--r--src/runas.c5
-rw-r--r--src/servdb.c4
-rw-r--r--src/shttp.c4
-rw-r--r--src/stevedore.c5
-rw-r--r--src/stevedore.h5
-rw-r--r--src/subagent.c4
-rw-r--r--src/tallyman.c7
-rw-r--r--src/tallyman.h8
11 files changed, 21 insertions, 34 deletions
diff --git a/src/config.c b/src/config.c
index aad6d5a..f43c00a 100644
--- a/src/config.c
+++ b/src/config.c
@@ -4,12 +4,9 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
+#include "stevedore.h"
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <syslog.h>
-#include "grecs.h"
-#include "stevedore.h"
#include "defs.h"
int log_facility = LOG_DAEMON;
diff --git a/src/pidfile.c b/src/pidfile.c
index b0a9db2..3200362 100644
--- a/src/pidfile.c
+++ b/src/pidfile.c
@@ -4,12 +4,9 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
-#include "config.h"
#include "stevedore.h"
#include <stdio.h>
#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
#include <errno.h>
#include <signal.h>
diff --git a/src/remoteip.c b/src/remoteip.c
index 0d858fe..a0440fc 100644
--- a/src/remoteip.c
+++ b/src/remoteip.c
@@ -4,16 +4,13 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
-#include <stdlib.h>
-#include <string.h>
+#include "stevedore.h"
#include <ctype.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <microhttpd.h>
-#include "stevedore.h"
-#include "grecs.h"
/* Returns 1 if ADDR is a valid string representation of IPv4 address */
static int
diff --git a/src/runas.c b/src/runas.c
index c0f7e85..97ceff1 100644
--- a/src/runas.c
+++ b/src/runas.c
@@ -4,14 +4,11 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
-#include <stdlib.h>
+#include "stevedore.h"
#include <unistd.h>
-#include <string.h>
#include <errno.h>
#include <pwd.h>
#include <grp.h>
-#include "grecs.h"
-#include "stevedore.h"
#ifndef SIZE_T_MAX
# define SIZE_T_MAX ((size_t)-1)
diff --git a/src/servdb.c b/src/servdb.c
index 8517f92..382f6c0 100644
--- a/src/servdb.c
+++ b/src/servdb.c
@@ -1,8 +1,6 @@
-#include <stdlib.h>
-#include <string.h>
+#include "stevedore.h"
#include <time.h>
#include <pthread.h>
-#include "stevedore.h"
#include "tallyman_mib.h"
#define MAX_SERVICE 1024
diff --git a/src/shttp.c b/src/shttp.c
index 60c6800..3d5851e 100644
--- a/src/shttp.c
+++ b/src/shttp.c
@@ -4,7 +4,7 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
-#include <config.h>
+#include "tallyman.h"
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@ -14,9 +14,7 @@ There is NO WARRANTY, to the extent permitted by law.
#include <fcntl.h>
#include <unistd.h>
#include "grecs.h"
-#include "grecs/json.h"
#include "wordsplit.h"
-#include "tallyman.h"
int shttp_verbose;
diff --git a/src/stevedore.c b/src/stevedore.c
index 7e6ccb0..27787da 100644
--- a/src/stevedore.c
+++ b/src/stevedore.c
@@ -4,11 +4,9 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
-#include "config.h"
+#include "stevedore.h"
#include <stdio.h>
-#include <stdlib.h>
#include <stdarg.h>
-#include <string.h>
#include <unistd.h>
#include <inttypes.h>
#include <sys/types.h>
@@ -26,7 +24,6 @@ There is NO WARRANTY, to the extent permitted by law.
#define MHD_PLATFORM_H
#include <microhttpd.h>
#include "defs.h"
-#include "stevedore.h"
int debug;
char *progname;
diff --git a/src/stevedore.h b/src/stevedore.h
index d9d5151..6870b8a 100644
--- a/src/stevedore.h
+++ b/src/stevedore.h
@@ -4,6 +4,11 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include "grecs.h"
#include "grecs/json.h"
diff --git a/src/subagent.c b/src/subagent.c
index 6b82287..f90c699 100644
--- a/src/subagent.c
+++ b/src/subagent.c
@@ -4,11 +4,9 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
-#include <stdlib.h>
-#include <string.h>
+#include "stevedore.h"
#include <time.h>
#include <pthread.h>
-#include "stevedore.h"
#include "tallyman_mib.h"
#include <signal.h>
diff --git a/src/tallyman.c b/src/tallyman.c
index 9ae6ca5..8135c00 100644
--- a/src/tallyman.c
+++ b/src/tallyman.c
@@ -4,24 +4,19 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
+#include "tallyman.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <arpa/inet.h>
#include <unistd.h>
-#include <net/if.h>
#include <limits.h>
#include <errno.h>
#include <getopt.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#include <sys/time.h>
#include <netdb.h>
#include <signal.h>
#include <setjmp.h>
-#include "grecs/json.h"
#include "runcap.h"
-#include "tallyman.h"
#include "defs.h"
enum {
diff --git a/src/tallyman.h b/src/tallyman.h
index 2b85d67..a191c10 100644
--- a/src/tallyman.h
+++ b/src/tallyman.h
@@ -4,6 +4,14 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include "grecs/json.h"
+
enum http_method {
METH_GET,
METH_POST,

Return to:

Send suggestions and report system problems to the System administrator.