Push WIN32 preprocessor derectives to csync_lock.c.

This commit is contained in:
Klaas Freitag 2013-04-22 14:30:12 +02:00
parent 072edefc7b
commit c46371b469
2 changed files with 3 additions and 7 deletions

View file

@ -57,6 +57,7 @@ set(csync_SRCS
csync_time.c
csync_util.c
csync_misc.c
csync_lock.c
csync_update.c
csync_reconcile.c
@ -68,10 +69,6 @@ set(csync_SRCS
vio/csync_vio_local.c
)
if(NOT WIN32)
list(APPEND csync_SRCS csync_lock.c)
endif()
set(csync_HDRS
csync.h
vio/csync_vio.h

View file

@ -41,6 +41,7 @@
#define CSYNC_LOG_CATEGORY_NAME "csync.lock"
#include "csync_log.h"
#ifndef _WIN32
static int _csync_lock_create(CSYNC *ctx, const char *lockfile) {
int fd = -1;
pid_t pid = 0;
@ -131,9 +132,6 @@ static pid_t _csync_lock_read(CSYNC *ctx, const char *lockfile) {
const _TCHAR *wlockfile;
/* Read PID from existing lock */
#ifdef _WIN32
_fmode = _O_BINARY;
#endif
wlockfile = c_multibyte(lockfile);
fd = _topen(wlockfile, O_RDONLY);
c_free_multibyte(wlockfile);
@ -179,6 +177,7 @@ static pid_t _csync_lock_read(CSYNC *ctx, const char *lockfile) {
return pid;
}
#endif
int csync_lock(CSYNC *ctx, const char *lockfile) {
#ifndef _WIN32