summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-03-09 19:50:37 +0100
committerLennart Poettering <lennart@poettering.net>2015-03-09 19:50:37 +0100
commit1952708abb10a47960d9160205e511343894896d (patch)
tree64522e372f2542cf32ba5bc801d4cd687b745a77
parent57b394b50579feeee90a4cb12243d5785a9176a6 (diff)
fsck: use _cleanup_close_pair_ where appropriate
-rw-r--r--src/fsck/fsck.c6
-rw-r--r--src/fsckd/fsckd.c1
2 files changed, 3 insertions, 4 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index a4a15da1bf..f3e90a8dbf 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -203,7 +203,7 @@ int main(int argc, char *argv[]) {
_cleanup_udev_device_unref_ struct udev_device *udev_device = NULL;
const char *device, *type;
bool root_directory;
- int progress_pipe[2] = { -1, -1 };
+ _cleanup_close_pair_ int progress_pipe[2] = { -1, -1 };
char dash_c[sizeof("-C")-1 + DECIMAL_STR_MAX(int) + 1];
struct stat st;
@@ -328,7 +328,7 @@ int main(int argc, char *argv[]) {
goto finish;
} else if (pid == 0) {
/* Child */
- safe_close(progress_pipe[0]);
+ progress_pipe[0] = safe_close(progress_pipe[0]);
execv(cmdline[0], (char**) cmdline);
_exit(8); /* Operational error */
}
@@ -373,7 +373,5 @@ int main(int argc, char *argv[]) {
touch("/run/systemd/quotacheck");
finish:
- safe_close_pair(progress_pipe);
-
return r;
}
diff --git a/src/fsckd/fsckd.c b/src/fsckd/fsckd.c
index 1415b53dd4..dedc828a89 100644
--- a/src/fsckd/fsckd.c
+++ b/src/fsckd/fsckd.c
@@ -82,6 +82,7 @@ typedef struct Manager {
sd_event_source *connection_event_source;
FILE *console;
+
double percent;
int numdevices;