]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move mworker.h to haproxy/mworker{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 12:07:37 +0000 (14:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:57 +0000 (10:18 +0200)
One function prototype makes reference to struct mworker_proc which was
not defined there but in global.h instead. This definition, along with
the PROC_O_* fields were moved to mworker-t.h instead.

include/haproxy/mworker-t.h [new file with mode: 0644]
include/haproxy/mworker.h [moved from include/proto/mworker.h with 83% similarity]
include/types/global.h
src/cli.c
src/haproxy.c
src/mworker-prog.c
src/mworker.c

diff --git a/include/haproxy/mworker-t.h b/include/haproxy/mworker-t.h
new file mode 100644 (file)
index 0000000..7712d28
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * include/haproxy/mworker-t.h
+ * Master Worker type definitions.
+ *
+ * Copyright HAProxy Technologies 2019 - William Lallemand <wlallemand@haproxy.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _HAPROXY_MWORKER_T_H_
+#define _HAPROXY_MWORKER_T_H_
+
+#include <haproxy/list.h>
+#include <types/signal.h>
+
+/* options for mworker_proc */
+
+#define PROC_O_TYPE_MASTER           0x00000001
+#define PROC_O_TYPE_WORKER           0x00000002
+#define PROC_O_TYPE_PROG             0x00000004
+/* 0x00000008 unused */
+#define PROC_O_LEAVING               0x00000010  /* this process should be leaving */
+/* 0x00000020 to 0x00000080 unused */
+#define PROC_O_START_RELOAD          0x00000100  /* Start the process even if the master was re-executed */
+
+/*
+ * Structure used to describe the processes in master worker mode
+ */
+struct server;
+struct mworker_proc {
+       int pid;
+       int options;
+       char *id;
+       char **command;
+       char *path;
+       char *version;
+       int ipc_fd[2]; /* 0 is master side, 1 is worker side */
+       int relative_pid;
+       int reloads;
+       int timestamp;
+       struct server *srv; /* the server entry in the master proxy */
+       struct list list;
+       int uid;
+       int gid;
+};
+
+#endif /* _HAPROXY_MWORKER_T_H_ */
similarity index 83%
rename from include/proto/mworker.h
rename to include/haproxy/mworker.h
index 595cc195061fe795405423f1d70380ab7e27b043..6d115ecf50954be1b0397ec495760c3da4d3ec09 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Master Worker
+ * include/haproxy/mworker-t.h
+ * Master Worker function prototypes.
  *
  * Copyright HAProxy Technologies 2019 - William Lallemand <wlallemand@haproxy.com>
  *
  *
  */
 
-#ifndef PROTO_MWORKER_H_
-#define PROTO_MWORKER_H_
+#ifndef _HAPROXY_MWORKER_H_
+#define _HAPROXY_MWORKER_H_
 
+#include <haproxy/mworker-t.h>
 #include <types/signal.h>
 
 void mworker_proc_list_to_env();
@@ -39,4 +41,4 @@ void mworker_kill_max_reloads(int sig);
 
 void mworker_free_child(struct mworker_proc *);
 
-#endif /* PROTO_MWORKER_H_ */
+#endif /* _HAPROXY_MWORKER_H_ */
index a00712c072c3d8c64bc1de1df7cae2d0eac5a0a3..9e60851c4e8df5fa8fd3778cd9886b64725b17b3 100644 (file)
@@ -181,36 +181,6 @@ struct global {
 #endif
 };
 
-/* options for mworker_proc */
-
-#define PROC_O_TYPE_MASTER           0x00000001
-#define PROC_O_TYPE_WORKER           0x00000002
-#define PROC_O_TYPE_PROG             0x00000004
-/* 0x00000008 unused */
-#define PROC_O_LEAVING               0x00000010  /* this process should be leaving */
-/* 0x00000020 to 0x00000080 unused */
-#define PROC_O_START_RELOAD          0x00000100  /* Start the process even if the master was re-executed */
-
-/*
- * Structure used to describe the processes in master worker mode
- */
-struct mworker_proc {
-       int pid;
-       int options;
-       char *id;
-       char **command;
-       char *path;
-       char *version;
-       int ipc_fd[2]; /* 0 is master side, 1 is worker side */
-       int relative_pid;
-       int reloads;
-       int timestamp;
-       struct server *srv; /* the server entry in the master proxy */
-       struct list list;
-       int uid;
-       int gid;
-};
-
 extern struct global global;
 extern int  pid;                /* current process id */
 extern int  relative_pid;       /* process id starting at 1 */
index 71e37f79d68b5e2e42400afbc2c3a8a93a638b09..db1900dd31f8cbc71011a25076c3953e7214c60f 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -31,6 +31,7 @@
 #include <haproxy/dns-t.h>
 #include <haproxy/frontend.h>
 #include <haproxy/list.h>
+#include <haproxy/mworker-t.h>
 #include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
index 1b5de8332cb9ee32f66bc61ab23ba49ef7e06824..a154123962f86a91ae251b4c81ec150be8ff878b 100644 (file)
@@ -92,6 +92,7 @@
 #include <haproxy/http_rules.h>
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
+#include <haproxy/mworker.h>
 #include <haproxy/namespace.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/openssl-compat.h>
 #include <proto/filters.h>
 #include <proto/listener.h>
 #include <proto/log.h>
-#include <proto/mworker.h>
 #include <proto/pattern.h>
 #include <haproxy/protocol.h>
 #include <proto/http_ana.h>
index 4951063d51ec3c0e3a39da710654d304a3690f05..0a448beab94e2a8b9b4fd68e3ca86ba572ba5dbc 100644 (file)
@@ -23,9 +23,9 @@
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/errors.h>
+#include <haproxy/mworker.h>
 
 #include <proto/log.h>
-#include <proto/mworker.h>
 
 static int use_program = 0; /* do we use the program section ? */
 
index 4f5ade24a7ec5f0b2d88de5651a6b7e4996337bd..fda50527c91ebe3d7b81466f0b044306e74ba1f3 100644 (file)
@@ -20,6 +20,7 @@
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/list.h>
+#include <haproxy/mworker.h>
 #include <haproxy/version.h>
 
 #include <types/cli.h>
@@ -31,7 +32,6 @@
 #include <haproxy/fd.h>
 #include <proto/listener.h>
 #include <proto/log.h>
-#include <proto/mworker.h>
 #include <proto/proxy.h>
 #include <proto/signal.h>
 #include <proto/stream.h>