chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: add the --plain option to the help message
[elogind.git]
/
src
/
remount-fs
/
remount-fs.c
diff --git
a/src/remount-fs/remount-fs.c
b/src/remount-fs/remount-fs.c
index f432718d6b9148d615fda958a88f90f4790318c3..847637a12ca3988e9f3970e2407e4a82bc54570a 100644
(file)
--- a/
src/remount-fs/remount-fs.c
+++ b/
src/remount-fs/remount-fs.c
@@
-40,7
+40,7
@@
int main(int argc, char *argv[]) {
int ret = EXIT_FAILURE;
int main(int argc, char *argv[]) {
int ret = EXIT_FAILURE;
- FILE *f = NULL;
+
_cleanup_endmntent_
FILE *f = NULL;
struct mntent* me;
Hashmap *pids = NULL;
struct mntent* me;
Hashmap *pids = NULL;
@@
-57,13
+57,11
@@
int main(int argc, char *argv[]) {
f = setmntent("/etc/fstab", "r");
if (!f) {
f = setmntent("/etc/fstab", "r");
if (!f) {
- if (errno == ENOENT) {
- ret = EXIT_SUCCESS;
- goto finish;
- }
+ if (errno == ENOENT)
+ return EXIT_SUCCESS;
log_error("Failed to open /etc/fstab: %m");
log_error("Failed to open /etc/fstab: %m");
-
goto finish
;
+
return EXIT_FAILURE
;
}
pids = hashmap_new(trivial_hash_func, trivial_compare_func);
}
pids = hashmap_new(trivial_hash_func, trivial_compare_func);
@@
-162,8
+160,5
@@
finish:
if (pids)
hashmap_free_free(pids);
if (pids)
hashmap_free_free(pids);
- if (f)
- endmntent(f);
-
return ret;
}
return ret;
}