From 85eca92e2061043d733991b386d8dc10fad0fc30 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 22 Oct 2015 18:24:59 +0200 Subject: path-util: rework find_binary(), fsck_exists() and mkfs_exists() Modernize the code a bit: - Get rid of FOREACH_WORD_SEPARATOR() loop in favour of a extract_first_word() loop. - Remove find_binary()'s "local" flag. It's not reasonably possible to look for binaries on remote systems, we hence should not pretend we could. - When we cannot find a suitable binary, return the last error returned from access() rather than ENOENT unconditionally. - Rework fsck_exists() and mkfs_exists() to return 1 on success, 0 if the implementation is missing and negative on real errors. This is more like we do it in other functions. - Make sure we also detect direct fsck symlinks to "true", rather than just absolute ones to /bin/true. --- src/basic/path-util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/basic/path-util.h') diff --git a/src/basic/path-util.h b/src/basic/path-util.h index 71e25f1e57..03e1ac5d60 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -58,7 +58,7 @@ int path_is_mount_point(const char *path, int flags); int path_is_read_only_fs(const char *path); int path_is_os_tree(const char *path); -int find_binary(const char *name, bool local, char **filename); +int find_binary(const char *name, char **filename); bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update); -- cgit v1.2.3-54-g00ecf