projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f51b761
)
btrfs-progs: cleanup after errors in open_file_or_dir3
author
David Sterba
<dsterba@suse.cz>
Tue, 9 Jun 2015 13:24:51 +0000
(15:24 +0200)
committer
David Sterba
<dsterba@suse.cz>
Tue, 9 Jun 2015 13:24:51 +0000
(15:24 +0200)
We should zero the dirstream in case we close it ourselves, so the
caller does not do it again. Most current callers do not do that and
exit immediatelly.
Signed-off-by: David Sterba <dsterba@suse.cz>
utils.c
patch
|
blob
|
history
diff --git
a/utils.c
b/utils.c
index
1783737
..
41a04bd
100644
(file)
--- a/
utils.c
+++ b/
utils.c
@@
-1915,8
+1915,10
@@
int open_file_or_dir3(const char *fname, DIR **dirstream, int open_flags)
}
if (fd < 0) {
fd = -1;
- if (*dirstream)
+ if (*dirstream)
{
closedir(*dirstream);
+ *dirstream = NULL;
+ }
}
return fd;
}