Skip to content

Commit c4e4bdf

Browse files
committed
Don't compile with syslog support for client and Windows.
1 parent d942428 commit c4e4bdf

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

common/log.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
#include <stdio.h>
66
#include <glib/gstdio.h>
7+
8+
#ifndef WIN32
9+
#ifdef SEAFILE_SERVER
710
#include <sys/syslog.h>
11+
#endif
12+
#endif
813

914
#include "log.h"
1015
#include "utils.h"
@@ -14,8 +19,15 @@ static int ccnet_log_level;
1419
static int seafile_log_level;
1520
static char *logfile;
1621
static FILE *logfp;
22+
23+
#ifndef WIN32
24+
#ifdef SEAFILE_SERVER
1725
static gboolean enable_syslog;
26+
#endif
27+
#endif
1828

29+
#ifndef WIN32
30+
#ifdef SEAFILE_SERVER
1931
static int
2032
get_syslog_level (GLogLevelFlags level)
2133
{
@@ -32,6 +44,8 @@ get_syslog_level (GLogLevelFlags level)
3244
return LOG_DEBUG;
3345
}
3446
}
47+
#endif
48+
#endif
3549

3650
static void
3751
seafile_log (const gchar *log_domain, GLogLevelFlags log_level,
@@ -57,8 +71,12 @@ seafile_log (const gchar *log_domain, GLogLevelFlags log_level,
5771
printf("%s %s", buf, message);
5872
}
5973

74+
#ifndef WIN32
75+
#ifdef SEAFILE_SERVER
6076
if (enable_syslog)
6177
syslog (get_syslog_level (log_level), "%s", message);
78+
#endif
79+
#endif
6280
}
6381

6482
static void
@@ -85,8 +103,12 @@ ccnet_log (const gchar *log_domain, GLogLevelFlags log_level,
85103
printf("%s %s", buf, message);
86104
}
87105

106+
#ifndef WIN32
107+
#ifdef SEAFILE_SERVER
88108
if (enable_syslog)
89109
syslog (get_syslog_level (log_level), "%s", message);
110+
#endif
111+
#endif
90112
}
91113

92114
static int
@@ -199,6 +221,8 @@ seafile_debug_impl (SeafileDebugFlags flag, const gchar *format, ...)
199221
}
200222
}
201223

224+
#ifndef WIN32
225+
#ifdef SEAFILE_SERVER
202226
void
203227
set_syslog_config (GKeyFile *config)
204228
{
@@ -208,3 +232,5 @@ set_syslog_config (GKeyFile *config)
208232
if (enable_syslog)
209233
openlog (NULL, LOG_NDELAY | LOG_PID, LOG_USER);
210234
}
235+
#endif
236+
#endif

common/log.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ int seafile_log_init (const char *logfile, const char *ccnet_debug_level_str,
1616
const char *seafile_debug_level_str);
1717
int seafile_log_reopen ();
1818

19+
#ifndef WIN32
20+
#ifdef SEAFILE_SERVER
1921
void
2022
set_syslog_config (GKeyFile *config);
23+
#endif
24+
#endif
2125

2226
void
2327
seafile_debug_set_flags_string (const gchar *flags_string);

controller/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
bin_PROGRAMS = seafile-controller
22

33
AM_CFLAGS = \
4+
-DSEAFILE_SERVER \
45
-I$(top_srcdir)/include \
56
-I$(top_srcdir)/lib \
67
-I$(top_builddir)/lib \

0 commit comments

Comments
 (0)