mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 23:31:03 +00:00
Fixes for redisLogFromHandler().
This commit is contained in:
parent
a7d12cbaf1
commit
5471b8babd
@ -307,7 +307,7 @@ void redisLogFromHandler(int level, const char *msg) {
|
|||||||
(server.logfile == NULL && server.daemonize)) return;
|
(server.logfile == NULL && server.daemonize)) return;
|
||||||
fd = server.logfile ?
|
fd = server.logfile ?
|
||||||
open(server.logfile, O_APPEND|O_CREAT|O_WRONLY, 0644) :
|
open(server.logfile, O_APPEND|O_CREAT|O_WRONLY, 0644) :
|
||||||
STDIN_FILENO;
|
STDOUT_FILENO;
|
||||||
if (fd == -1) return;
|
if (fd == -1) return;
|
||||||
ll2string(buf,sizeof(buf),getpid());
|
ll2string(buf,sizeof(buf),getpid());
|
||||||
write(fd,"[",1);
|
write(fd,"[",1);
|
||||||
@ -318,7 +318,7 @@ void redisLogFromHandler(int level, const char *msg) {
|
|||||||
write(fd,") ",2);
|
write(fd,") ",2);
|
||||||
write(fd,msg,strlen(msg));
|
write(fd,msg,strlen(msg));
|
||||||
write(fd,"\n",1);
|
write(fd,"\n",1);
|
||||||
close(fd);
|
if (server.logfile) close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Redis generally does not try to recover from out of memory conditions
|
/* Redis generally does not try to recover from out of memory conditions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user