Skip to content

Commit 7b51d5a

Browse files
committed
Clean the headers
1 parent d850bce commit 7b51d5a

File tree

13 files changed

+31
-115
lines changed

13 files changed

+31
-115
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ set(CMAKE_LIBRARY_PATH "")
9696
set(CMAKE_INCLUDE_PATH "")
9797
include_directories(AFTER ${GLIB2_INCLUDE_DIRS})
9898

99+
add_definitions(-DLOG_DOMAIN="gridinit")
100+
add_definitions(-DGRIDINIT_DOMAIN="gridinit")
101+
99102
add_subdirectory(./lib)
100103
add_subdirectory(./main)
101104

lib/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ add_library(gridinit-utils STATIC
55
uid.c
66
common.c
77
limits.c
8-
children.c
9-
gridinit-utils.h
10-
gridinit-internals.h)
8+
children.c)
119

1210
target_link_libraries(gridinit-utils
1311
${GLIB2_LIBRARIES})

lib/children.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ You should have received a copy of the GNU Affero General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
#ifdef HAVE_CONFIG_H
21-
# include "../config.h"
22-
#endif
23-
2420
#include <stdlib.h>
2521
#include <string.h>
2622
#include <errno.h>
@@ -33,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3329
#include <glib.h>
3430

3531
#include "./gridinit-utils.h"
36-
#include "./gridinit-internals.h"
3732

3833
time_t supervisor_default_delay_KILL = SUPERVISOR_DEFAULT_TIMEOUT_KILL;
3934

lib/common.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ You should have received a copy of the GNU Affero General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
#ifdef HAVE_CONFIG_H
21-
# include "../config.h"
22-
#endif
23-
24-
#include "./gridinit-utils.h"
25-
#include "./gridinit-internals.h"
26-
2720
#include <sys/types.h>
2821
#include <unistd.h>
2922

23+
#include "./gridinit-utils.h"
24+
3025
GError*
3126
g_error_printf(const char *dom, int code, const char *fmt, ...)
3227
{

lib/gridinit-internals.h

Lines changed: 0 additions & 47 deletions
This file was deleted.

lib/gridinit-utils.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3232
# include <sys/types.h>
3333
# include <unistd.h>
3434

35+
# define GRID_LOGLVL_TRACE (32 << G_LOG_LEVEL_USER_SHIFT)
36+
# define GRID_LOGLVL_DEBUG (16 << G_LOG_LEVEL_USER_SHIFT)
37+
# define GRID_LOGLVL_INFO (8 << G_LOG_LEVEL_USER_SHIFT)
38+
# define GRID_LOGLVL_NOTICE (4 << G_LOG_LEVEL_USER_SHIFT)
39+
# define GRID_LOGLVL_WARN (2 << G_LOG_LEVEL_USER_SHIFT)
40+
# define GRID_LOGLVL_ERROR (1 << G_LOG_LEVEL_USER_SHIFT)
41+
42+
# define FATAL(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_ERROR, Format, ##__VA_ARGS__)
43+
# define ALERT(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_ERROR, Format, ##__VA_ARGS__)
44+
# define CRIT(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_ERROR, Format, ##__VA_ARGS__)
45+
# define ERROR(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_ERROR, Format, ##__VA_ARGS__)
46+
# define WARN(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_WARN, Format, ##__VA_ARGS__)
47+
# define NOTICE(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_NOTICE, Format, ##__VA_ARGS__)
48+
# define INFO(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_INFO, Format, ##__VA_ARGS__)
49+
# define DEBUG(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_DEBUG, Format, ##__VA_ARGS__)
50+
# define TRACE(Format,...) g_log(GRIDINIT_DOMAIN, GRID_LOGLVL_TRACE, Format, ##__VA_ARGS__)
51+
52+
GError* g_error_printf(const char *dom, int code, const char *fmt, ...);
53+
3554
extern time_t supervisor_default_delay_KILL;
3655

3756
/* Children monitoring ----------------------------------------------------- */

lib/limits.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,15 @@ You should have received a copy of the GNU Affero General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
#ifdef HAVE_CONFIG_H
21-
# include "../config.h"
22-
#endif
23-
24-
#include "./gridinit-utils.h"
25-
#include "./gridinit-internals.h"
26-
2720
#include <string.h>
2821
#include <errno.h>
2922
#include <stdint.h>
3023
#include <sys/types.h>
3124
#include <sys/resource.h>
3225
#include <unistd.h>
3326

27+
#include "./gridinit-utils.h"
28+
3429
static const char*
3530
get_rlimit_name(enum supervisor_limit_e what)
3631
{

lib/uid.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,15 @@ You should have received a copy of the GNU Affero General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
#ifdef HAVE_CONFIG_H
21-
# include "../config.h"
22-
#endif
23-
24-
#include "./gridinit-utils.h"
25-
#include "./gridinit-internals.h"
26-
2720
#include <string.h>
2821
#include <errno.h>
2922
#include <sys/types.h>
3023
#include <unistd.h>
3124
#include <pwd.h>
3225
#include <grp.h>
3326

27+
#include "./gridinit-utils.h"
28+
3429
static volatile uid_t effective_uid = 0;
3530
static volatile uid_t effective_gid = 0;
3631

main/alerting.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,13 @@ You should have received a copy of the GNU Affero General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
#ifdef HAVE_CONFIG_H
21-
# include "../config.h"
22-
#endif
23-
#ifndef LOG_DOMAIN
24-
# define LOG_DOMAIN "gridinit"
25-
#endif
26-
2720
#include <event.h>
2821
#include <glib.h>
2922
#include <gmodule.h>
3023

3124
#include <gridinit-utils.h>
3225
#include "./gridinit_internals.h"
3326
#include "./gridinit_alerts.h"
34-
#include "../lib/gridinit-internals.h"
3527

3628
static GModule *module = NULL;
3729
static struct gridinit_alert_handle_s *handle = NULL;

main/cnx.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ You should have received a copy of the GNU Affero General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
#ifdef HAVE_CONFIG_H
21-
# include "../config.h"
22-
#endif
23-
#ifndef LOG_DOMAIN
24-
# define LOG_DOMAIN "gridinit"
25-
#endif
26-
2720
#include <stdlib.h>
2821
#include <stdio.h>
2922
#include <errno.h>
@@ -42,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4235
#include <glib.h>
4336

4437
#include "./gridinit_internals.h"
45-
#include "../lib/gridinit-internals.h"
38+
#include "../lib/gridinit-utils.h"
4639

4740
static volatile int backlog_unix = 65536;
4841
static volatile int backlog_tcp = 4096;

0 commit comments

Comments
 (0)