chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c6a7c0
)
fsck: skip checking / if it is writable
author
Kay Sievers
<kay.sievers@vrfy.org>
Fri, 29 Oct 2010 17:54:02 +0000
(19:54 +0200)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Fri, 29 Oct 2010 17:55:21 +0000
(19:55 +0200)
src/fsck.c
patch
|
blob
|
history
diff --git
a/src/fsck.c
b/src/fsck.c
index bfa35f2e56958a5f28c89e5b7be6c09142574227..3c1652bc223ab7cf4b4912f16105d0adfe0d21a1 100644
(file)
--- a/
src/fsck.c
+++ b/
src/fsck.c
@@
-24,6
+24,7
@@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
+#include <fcntl.h>
#include <libudev.h>
#include <dbus/dbus.h>
#include <libudev.h>
#include <dbus/dbus.h>
@@
-170,6
+171,7
@@
int main(int argc, char *argv[]) {
root_directory = false;
} else {
struct stat st;
root_directory = false;
} else {
struct stat st;
+ struct timespec times[2];
/* Find root device */
/* Find root device */
@@
-182,6
+184,14
@@
int main(int argc, char *argv[]) {
if (major(st.st_dev) == 0)
return 0;
if (major(st.st_dev) == 0)
return 0;
+ /* check if we are already writable */
+ times[0] = st.st_atim;
+ times[1] = st.st_mtim;
+ if (utimensat(AT_FDCWD, "/", times, 0) == 0) {
+ log_error("Root directory is writable, skip check.");
+ goto finish;
+ }
+
if (!(udev = udev_new())) {
log_error("Out of memory");
goto finish;
if (!(udev = udev_new())) {
log_error("Out of memory");
goto finish;