chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fsck: Search for fsck.type in PATH
[elogind.git]
/
src
/
shared
/
generator.c
diff --git
a/src/shared/generator.c
b/src/shared/generator.c
index 61103031db23b31df7a5d7c79dc98d11608a3d4a..5ac7b5f02f379fae03a7ff5392b77f6d6ee6a8e1 100644
(file)
--- a/
src/shared/generator.c
+++ b/
src/shared/generator.c
@@
-19,6
+19,7
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <string.h>
#include <unistd.h>
#include "util.h"
#include <unistd.h>
#include "util.h"
@@
-26,6
+27,7
@@
#include "mkdir.h"
#include "unit-name.h"
#include "generator.h"
#include "mkdir.h"
#include "unit-name.h"
#include "generator.h"
+#include "path-util.h"
int generator_write_fsck_deps(
FILE *f,
int generator_write_fsck_deps(
FILE *f,
@@
-45,16
+47,12
@@
int generator_write_fsck_deps(
}
if (!isempty(fstype) && !streq(fstype, "auto")) {
}
if (!isempty(fstype) && !streq(fstype, "auto")) {
- const char *checker;
int r;
int r;
-
- checker = strappenda("/sbin/fsck.", fstype);
- r = access(checker, X_OK);
+ r = fsck_exists(fstype);
if (r < 0) {
if (r < 0) {
- log_warning("Checking was requested for %s, but %s cannot be used: %m", what, checker);
-
+ log_warning("Checking was requested for %s, but fsck.%s cannot be used: %s", what, fstype, strerror(-r));
/* treat missing check as essentially OK */
/* treat missing check as essentially OK */
- return
errno == ENOENT ? 0 : -errno
;
+ return
r == -ENOENT ? 0 : r
;
}
}
}
}