X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=sidebyside;f=common.h;h=f7dd9780aba11dd712b92afa0b18088e269a57da;hb=cd6d97ab05dc231c35cf0dd38afaa43f0ab1fd99;hp=449ead55b068e9ae6d9a8b079176463368bd5b06;hpb=dbc6818c72dfe618b164db970773490b19b808c5;p=apps%2Fpfixtools.git diff --git a/common.h b/common.h index 449ead5..f7dd978 100644 --- a/common.h +++ b/common.h @@ -33,17 +33,17 @@ * Copyright © 2007 Pierre Habouzit */ -#ifndef PFIXTOOLS_H -#define PFIXTOOLS_H +#ifndef PFIXTOOLS_COMMON_H +#define PFIXTOOLS_COMMON_H #include #include #include #include -#include #include #include #include +#include #include #include #include @@ -54,6 +54,8 @@ #include #include +#include "mem.h" + #define UNIXERR(fun) \ syslog(LOG_ERR, "%s:%d:%s: %s: %m", \ __FILE__, __LINE__, __func__, fun) @@ -67,19 +69,19 @@ typedef void (*exitcall_t)(void); #define module_init(fn) static __init initcall_t __init_##fn = fn; #define module_exit(fn) static __exit exitcall_t __exit_##fn = fn; -/* common.c */ extern sig_atomic_t sigint; extern sig_atomic_t sighup; void common_sighandler(int sig); -void common_initialize(void); -void common_shutdown(void); -/* daemon.c */ int tcp_listen_nonblock(const struct sockaddr *addr, socklen_t len); int accept_nonblock(int fd); +int xwrite(int fd, const char *s, size_t l); int daemon_detach(void); int drop_privileges(const char *user, const char *group); +int pidfile_open(const char *name); +int pidfile_refresh(void); + #endif