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
6fa987e3
Commit
6fa987e3
authored
Jan 15, 2010
by
antirez
Browse files
Create swap file only if not exists
parent
459f52a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
6fa987e3
...
...
@@ -7035,9 +7035,13 @@ static void vmInit(void) {
expandVmSwapFilename
();
redisLog
(
REDIS_NOTICE
,
"Using '%s' as swap file"
,
server
.
vm_swap_file
);
server.vm_fp = fopen(server.vm_swap_file,"r+b");
if
((
server
.
vm_fp
=
fopen
(
server
.
vm_swap_file
,
"r+b"
))
==
NULL
)
{
server
.
vm_fp
=
fopen
(
server
.
vm_swap_file
,
"w+b"
);
}
if
(
server
.
vm_fp
==
NULL
)
{
redisLog(REDIS_WARNING,"Impossible to open the swap file. Exiting.");
redisLog
(
REDIS_WARNING
,
"Impossible to open the swap file: %s. Exiting."
,
strerror
(
errno
));
exit
(
1
);
}
server
.
vm_fd
=
fileno
(
server
.
vm_fp
);
...
...
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