mirror of
https://github.com/octoleo/lsyncd.git
synced 2025-01-23 07:08:33 +00:00
Finally fixed mysterious error 13. rsync fails 'cause Lsyncd reopened stderr in read mode
This commit is contained in:
parent
d667b90864
commit
5ce47d47a3
@ -2,6 +2,8 @@
|
|||||||
fix: no longer stops syslogging on HUP signals
|
fix: no longer stops syslogging on HUP signals
|
||||||
fix: OSX event watcher no longer misses moves into and out of the watch tree
|
fix: OSX event watcher no longer misses moves into and out of the watch tree
|
||||||
fix: not refinding a relative path to the config file in case of HUP.
|
fix: not refinding a relative path to the config file in case of HUP.
|
||||||
|
fix: rsync doing error 13 and killing Lsyncd.
|
||||||
|
see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659941
|
||||||
change: Lsyncd now remembers the absolute path of its config file during HUPs
|
change: Lsyncd now remembers the absolute path of its config file during HUPs
|
||||||
|
|
||||||
25-08-2011: 2.0.5
|
25-08-2011: 2.0.5
|
||||||
|
6
lsyncd.c
6
lsyncd.c
@ -479,6 +479,7 @@ close_exec_fd(int fd)
|
|||||||
logstring("Error", "cannot get descriptor flags!");
|
logstring("Error", "cannot get descriptor flags!");
|
||||||
exit(-1); // ERRNO
|
exit(-1); // ERRNO
|
||||||
}
|
}
|
||||||
|
|
||||||
flags |= FD_CLOEXEC;
|
flags |= FD_CLOEXEC;
|
||||||
if (fcntl(fd, F_SETFD, flags) == -1) {
|
if (fcntl(fd, F_SETFD, flags) == -1) {
|
||||||
logstring("Error", "cannot set descripptor flags!");
|
logstring("Error", "cannot set descripptor flags!");
|
||||||
@ -904,6 +905,7 @@ l_exec(lua_State *L)
|
|||||||
if (!freopen(settings.log_file, "a", stdout)) {
|
if (!freopen(settings.log_file, "a", stdout)) {
|
||||||
printlogf(L, "Error", "cannot redirect stdout to '%s'.", settings.log_file);
|
printlogf(L, "Error", "cannot redirect stdout to '%s'.", settings.log_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!freopen(settings.log_file, "a", stderr)) {
|
if (!freopen(settings.log_file, "a", stderr)) {
|
||||||
printlogf(L, "Error", "cannot redirect stderr to '%s'.", settings.log_file);
|
printlogf(L, "Error", "cannot redirect stderr to '%s'.", settings.log_file);
|
||||||
}
|
}
|
||||||
@ -1466,8 +1468,8 @@ daemonize(lua_State *L)
|
|||||||
|
|
||||||
// disconnects stdstreams
|
// disconnects stdstreams
|
||||||
if (!freopen("/dev/null", "r", stdin) ||
|
if (!freopen("/dev/null", "r", stdin) ||
|
||||||
!freopen("/dev/null", "r", stdout) ||
|
!freopen("/dev/null", "w", stdout) ||
|
||||||
!freopen("/dev/null", "r", stderr)
|
!freopen("/dev/null", "w", stderr)
|
||||||
) {
|
) {
|
||||||
printlogf(L, "Error", "Failure in daemonize at freopen(/dev/null, std[in|out|err])");
|
printlogf(L, "Error", "Failure in daemonize at freopen(/dev/null, std[in|out|err])");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user