Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
0b305fcf
Commit
0b305fcf
authored
Jan 03, 2011
by
antirez
Browse files
diskstore FLUSH* fixed
parent
c15a3887
Changes
1
Show whitespace changes
Inline
Side-by-side
src/diskstore.c
View file @
0b305fcf
...
...
@@ -282,6 +282,8 @@ void dsFlushOneDir(char *path, int dbid) {
redisPanic
(
"Unrecoverable Disk store errore. Existing."
);
}
while
(
1
)
{
char
buf
[
1024
];
readdir_r
(
dir
,
&
de
,
&
dp
);
if
(
dp
==
NULL
)
break
;
if
(
dp
->
d_name
[
0
]
==
'.'
)
continue
;
...
...
@@ -298,9 +300,12 @@ void dsFlushOneDir(char *path, int dbid) {
id
[
len
]
=
'\0'
;
if
(
atoi
(
id
)
!=
dbid
)
continue
;
/* skip this file */
}
if
(
unlink
(
dp
->
d_name
)
==
-
1
)
{
/* Finally unlink the file */
snprintf
(
buf
,
1024
,
"%s/%s"
,
path
,
dp
->
d_name
);
if
(
unlink
(
buf
)
==
-
1
)
{
redisLog
(
REDIS_WARNING
,
"Can't unlink %s: %s"
,
path
,
strerror
(
errno
));
"Can't unlink %s: %s"
,
buf
,
strerror
(
errno
));
redisPanic
(
"Unrecoverable Disk store errore. Existing."
);
}
}
...
...
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