mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Do not check for fcntl.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4931 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ee34525905
commit
75666168b7
@ -178,8 +178,6 @@ case "$host_os" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
AC_CHECK_FUNCS(fcntl)
|
|
||||||
|
|
||||||
AC_CHECK_FUNC(socket, [], [
|
AC_CHECK_FUNC(socket, [], [
|
||||||
AC_CHECK_LIB(socket, socket, [
|
AC_CHECK_LIB(socket, socket, [
|
||||||
LIBS="$LIBS -lsocket"
|
LIBS="$LIBS -lsocket"
|
||||||
|
@ -32,9 +32,7 @@
|
|||||||
|
|
||||||
#define DEFAULT_LOG_FILE_CREATE_MODE 600
|
#define DEFAULT_LOG_FILE_CREATE_MODE 600
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL
|
|
||||||
static struct flock lock;
|
static struct flock lock;
|
||||||
#endif
|
|
||||||
|
|
||||||
GSList *logs;
|
GSList *logs;
|
||||||
|
|
||||||
@ -129,7 +127,6 @@ int log_start_logging(LOG_REC *log)
|
|||||||
log->failed = TRUE;
|
log->failed = TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_FCNTL
|
|
||||||
memset(&lock, 0, sizeof(lock));
|
memset(&lock, 0, sizeof(lock));
|
||||||
lock.l_type = F_WRLCK;
|
lock.l_type = F_WRLCK;
|
||||||
if (fcntl(log->handle, F_SETLK, &lock) == -1 && errno == EACCES) {
|
if (fcntl(log->handle, F_SETLK, &lock) == -1 && errno == EACCES) {
|
||||||
@ -139,7 +136,6 @@ int log_start_logging(LOG_REC *log)
|
|||||||
log->failed = TRUE;
|
log->failed = TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
lseek(log->handle, 0, SEEK_END);
|
lseek(log->handle, 0, SEEK_END);
|
||||||
|
|
||||||
log->opened = log->last = time(NULL);
|
log->opened = log->last = time(NULL);
|
||||||
@ -165,11 +161,9 @@ void log_stop_logging(LOG_REC *log)
|
|||||||
settings_get_str("log_close_string"),
|
settings_get_str("log_close_string"),
|
||||||
"\n", time(NULL));
|
"\n", time(NULL));
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL
|
|
||||||
memset(&lock, 0, sizeof(lock));
|
memset(&lock, 0, sizeof(lock));
|
||||||
lock.l_type = F_UNLCK;
|
lock.l_type = F_UNLCK;
|
||||||
fcntl(log->handle, F_SETLK, &lock);
|
fcntl(log->handle, F_SETLK, &lock);
|
||||||
#endif
|
|
||||||
|
|
||||||
write_buffer_flush();
|
write_buffer_flush();
|
||||||
close(log->handle);
|
close(log->handle);
|
||||||
|
Loading…
Reference in New Issue
Block a user