Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
clsync
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2015-05-13 17:10:01 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3b884468c8e0212a4884ac6535fcec04b0908ff6
3b884468
1 parent
b4c401a0
Headers polishing
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
103 additions
and
94 deletions
common.h
configuration.h
configure.ac
error.c
libclsync.c
macros.h
malloc.c
socket.c
common.h
View file @
3b88446
...
...
@@ -87,65 +87,7 @@
# define IN_CREATE_SELF IN_CREATE
#endif
#ifdef _DEBUG
# define DEBUGV(...) __VA_ARGS__
#else
# define DEBUGV(...)
#endif
#ifdef PARANOID
# define PARANOIDV(...) __VA_ARGS__
#else
# define PARANOIDV(...)
#endif
#ifdef _GNU_SOURCE
# ifndef likely
# define likely(x) __builtin_expect(!!(x), 1)
# endif
# ifndef unlikely
# define unlikely(x) __builtin_expect(!!(x), 0)
# endif
#else
# ifndef likely
# define likely(x) (x)
# endif
# ifndef unlikely
# define unlikely(x) (x)
# endif
#endif
#ifndef offsetof
# define offsetof(a, b) __builtin_offsetof(a, b)
#endif
// clang defines "__GNUC__", but not compatible with gnuc. Fixing.
#ifdef __clang__
# ifdef __GNUC__
# undef __GNUC__
# endif
#endif
#define TOSTR(a) # a
#define XTOSTR(a) TOSTR(a)
#define COLLECTDELAY_INSTANT ((unsigned int)~0)
#define MSG_SECURITY_PROBLEM(a) "Security problem: "a". Don't use this application until the bug will be fixed. Report about the problem to: "AUTHOR
#define require_strlen_le(str, limit) \
if (strlen(str) >= limit)\
critical("length of "TOSTR(str)" (\"%s\") >= "TOSTR(limit));\
#define SAFE(code, onfail) ({\
long _SAFE_rc;\
if ((_SAFE_rc = code)) {\
error("Got error while "TOSTR(code));\
onfail;\
} \
_SAFE_rc;\
})
#include "macros.h"
enum
paramsource_enum
{
PS_UNKNOWN
=
0
,
...
...
configuration.h
View file @
3b88446
...
...
@@ -36,45 +36,47 @@
#define MAXMOUNTPOINTS (1<<8)
#define MAXPERMITTEDHOOKFILES (1<<8)
#ifdef __CLSYNC_COMMON_H
# ifndef DEFAULT_NOTIFYENGINE
# ifdef __linux__
#ifndef PIC
# ifdef __CLSYNC_COMMON_H
# ifndef DEFAULT_NOTIFYENGINE
# ifdef __linux__
# ifdef INOTIFY_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_INOTIFY
# endif
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# ifdef __FreeBSD__
# ifdef KQUEUE_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_KQUEUE
# endif
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# ifdef INOTIFY_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_INOTIFY
# endif
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# ifdef __FreeBSD__
# ifndef DEFAULT_NOTIFYENGINE
# ifdef GIO_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_GIO
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# ifdef KQUEUE_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_KQUEUE
# endif
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# ifdef INOTIFY_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_INOTIFY
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# ifdef GIO_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_GIO
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# ifdef KQUEUE_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_KQUEUE
# ifndef DEFAULT_NOTIFYENGINE
# ifdef BSM_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_BSM
# endif
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# ifdef BSM_SUPPORT
# define DEFAULT_NOTIFYENGINE NE_BSM
# ifndef DEFAULT_NOTIFYENGINE
# error No monitor subsystem supported
# define DEFAULT_NOTIFYENGINE NE_UNDEFINED
# endif
# endif
# ifndef DEFAULT_NOTIFYENGINE
# error No monitor subsystem supported
# define DEFAULT_NOTIFYENGINE NE_UNDEFINED
# endif
#endif
#define DEFAULT_RULES_PERM RA_ALL
...
...
configure.ac
View file @
3b88446
...
...
@@ -65,7 +65,7 @@ AS_IF([test "x$enable_cluster" = "xyes"], [CPPFLAGS="${CPPFLAGS} -DCLUSTER_SUPPO
AS_IF([test "x$with_mhash" = "xno"], [], [
AC_CHECK_HEADER([mhash.h], [], [AC_MSG_ERROR("Unable to find mhash.h")])
AC_SEARCH_LIBS([mhash_init], [mhash], [CPPFLAGS="${CPPFLAGS} -DHAVE_MHASH"],
AC_SEARCH_LIBS([mhash_init], [mhash], [CPPFLAGS="${CPPFLAGS} -DHAVE_MHASH"
; LDFLAGS="${LDFLAGS} -lmhash"
],
[AC_MSG_ERROR("Unable to find libmhash")])
])
])
...
...
error.c
View file @
3b88446
...
...
@@ -22,8 +22,6 @@
* to be slow but convenient functions.
*/
#include "common.h"
#include <stdlib.h>
#include <execinfo.h>
#include <stdio.h>
...
...
@@ -32,6 +30,12 @@
#include <stdarg.h>
#include <syslog.h>
#include <pthread.h>
/* pthread_self() */
#include <sys/types.h>
/* getpid() */
#include <unistd.h>
/* getpid() */
#include "configuration.h"
#include "error.h"
#include "pthreadex.h"
/* pthread_*_shared() */
...
...
libclsync.c
View file @
3b88446
...
...
@@ -18,7 +18,6 @@
*/
#define LIBCLSYNC
#include "common.h"
#include <errno.h>
#include <stdlib.h>
...
...
macros.h
0 → 100644
View file @
3b88446
#ifndef __CLSYNC_MACROS_H
#define __CLSYNC_MACROS_H
#ifdef _DEBUG
# define DEBUGV(...) __VA_ARGS__
#else
# define DEBUGV(...)
#endif
#ifdef PARANOID
# define PARANOIDV(...) __VA_ARGS__
#else
# define PARANOIDV(...)
#endif
#ifdef _GNU_SOURCE
# ifndef likely
# define likely(x) __builtin_expect(!!(x), 1)
# endif
# ifndef unlikely
# define unlikely(x) __builtin_expect(!!(x), 0)
# endif
#else
# ifndef likely
# define likely(x) (x)
# endif
# ifndef unlikely
# define unlikely(x) (x)
# endif
#endif
#ifndef offsetof
# define offsetof(a, b) __builtin_offsetof(a, b)
#endif
// clang defines "__GNUC__", but not compatible with gnuc. Fixing.
#ifdef __clang__
# ifdef __GNUC__
# undef __GNUC__
# endif
#endif
#define TOSTR(a) # a
#define XTOSTR(a) TOSTR(a)
#define COLLECTDELAY_INSTANT ((unsigned int)~0)
#define MSG_SECURITY_PROBLEM(a) "Security problem: "a". Don't use this application until the bug will be fixed. Report about the problem to: "AUTHOR
#define require_strlen_le(str, limit) \
if (strlen(str) >= limit)\
critical("length of "TOSTR(str)" (\"%s\") >= "TOSTR(limit));\
#define SAFE(code, onfail) ({\
long _SAFE_rc;\
if ((_SAFE_rc = code)) {\
error("Got error while "TOSTR(code));\
onfail;\
} \
_SAFE_rc;\
})
#endif
...
...
malloc.c
View file @
3b88446
...
...
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "
common
.h"
#include "
macros
.h"
#include <stdlib.h>
#include <string.h>
...
...
socket.c
View file @
3b88446
...
...
@@ -17,8 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
...
...
Please
register
or
login
to post a comment