summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-20 00:44:09 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-20 00:44:09 +0200
commitdc8e15c206ace4f9b424ea6c114a2bc7ee127eab (patch)
tree9b32adec9b83dee133ed5f7ea160226c8d60ce68 /src
parent335aa753fa60ba0bb3c9fe679c761d5f1f3b1588 (diff)
fsck: don't be idempotent for root directories
Diffstat (limited to 'src')
-rw-r--r--src/fsck.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/fsck.c b/src/fsck.c
index eca2212f47..e13dcf4d9d 100644
--- a/src/fsck.c
+++ b/src/fsck.c
@@ -142,6 +142,7 @@ int main(int argc, char *argv[]) {
struct udev *udev = NULL;
struct udev_device *udev_device = NULL;
const char *device;
+ bool root_directory;
if (argc > 2) {
log_error("This program expects one or no arguments.");
@@ -158,9 +159,10 @@ int main(int argc, char *argv[]) {
if (!arg_force && arg_skip)
return 0;
- if (argc > 1)
+ if (argc > 1) {
device = argv[1];
- else {
+ root_directory = false;
+ } else {
struct stat st;
/* Find root device */
@@ -188,13 +190,17 @@ int main(int argc, char *argv[]) {
log_error("Failed to detect device node of root directory.");
goto finish;
}
+
+ root_directory = true;
}
cmdline[i++] = "/sbin/fsck";
cmdline[i++] = "-a";
cmdline[i++] = "-T";
cmdline[i++] = "-C";
- cmdline[i++] = "-M";
+
+ if (!root_directory)
+ cmdline[i++] = "-M";
if (arg_force)
cmdline[i++] = "-f";