diff options
author | Daniel Mack <github@zonque.org> | 2015-10-23 10:50:53 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-10-23 10:50:53 +0200 |
commit | 952b4473bc392652b1d4c9dae5ec88fd003c4e1d (patch) | |
tree | 8d27afa9b27ceb997013868f2b80a4bb5a993911 /src/basic/path-util.c | |
parent | c9fc270e462bf2f4eab963bf71234d64b0c4c30f (diff) | |
parent | b0830e21f47109d8a6ba2fc0afbf9b2ca1ffc2a9 (diff) |
Merge pull request #1641 from poettering/btrfs-quota
btrfs quota beef up and various other unrelated changes
Diffstat (limited to 'src/basic/path-util.c')
-rw-r--r-- | src/basic/path-util.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 5cbfc145a4..1039623305 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -796,14 +796,11 @@ bool paths_check_timestamp(const char* const* paths, usec_t *timestamp, bool upd return changed; } -int fsck_exists(const char *fstype) { +static int binary_is_good(const char *binary) { _cleanup_free_ char *p = NULL, *d = NULL; - const char *checker; int r; - checker = strjoina("fsck.", fstype); - - r = find_binary(checker, true, &p); + r = find_binary(binary, true, &p); if (r < 0) return r; @@ -820,6 +817,22 @@ int fsck_exists(const char *fstype) { return 0; } +int fsck_exists(const char *fstype) { + const char *checker; + + checker = strjoina("fsck.", fstype); + + return binary_is_good(checker); +} + +int mkfs_exists(const char *fstype) { + const char *mkfs; + + mkfs = strjoina("mkfs.", fstype); + + return binary_is_good(mkfs); +} + char *prefix_root(const char *root, const char *path) { char *n, *p; size_t l; |