Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
5a7c647e
Commit
5a7c647e
authored
Apr 29, 2009
by
antirez
Browse files
Check for fork() failure in background saving
parent
3a2694c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
5a7c647e
...
@@ -1879,6 +1879,11 @@ static int rdbSaveBackground(char *filename) {
...
@@ -1879,6 +1879,11 @@ static int rdbSaveBackground(char *filename) {
}
}
}
else
{
}
else
{
/* Parent */
/* Parent */
if
(
childpid
==
-
1
)
{
redisLog
(
REDIS_WARNING
,
"Can't save in background: fork: %s"
,
strerror
(
errno
));
return
REDIS_ERR
;
}
redisLog
(
REDIS_NOTICE
,
"Background saving started by pid %d"
,
childpid
);
redisLog
(
REDIS_NOTICE
,
"Background saving started by pid %d"
,
childpid
);
server
.
bgsaveinprogress
=
1
;
server
.
bgsaveinprogress
=
1
;
return
REDIS_OK
;
return
REDIS_OK
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment