diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-01-18 10:04:04 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-01-18 10:04:04 +0100 |
commit | 18606801f741a34affbd0628737417daadd0c620 (patch) | |
tree | 55c2855223fe8db22267862b9f826a0722e99730 /nlplug-findfs.c | |
parent | 5fc705baf54b1a0b8e35c22f0e4dd7fab0162aad (diff) | |
download | mkinitfs-18606801f741a34affbd0628737417daadd0c620.tar.bz2 mkinitfs-18606801f741a34affbd0628737417daadd0c620.tar.xz |
nlplug-findfs: allow success even if nothing found
add -n option to allow return success even if nothing was found. This is
useful for net boot, where apkovl and repositories are on network.
Diffstat (limited to 'nlplug-findfs.c')
-rw-r--r-- | nlplug-findfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nlplug-findfs.c b/nlplug-findfs.c index 7d1511e..b2b5ac8 100644 --- a/nlplug-findfs.c +++ b/nlplug-findfs.c @@ -840,6 +840,7 @@ int main(int argc, char *argv[]) int event_count = 0; size_t total_bytes = 0; int found = 0; + int not_found_is_ok = 0; char *program_argv[2] = {0,0}; pthread_t tid; sigset_t sigchldmask; @@ -875,6 +876,9 @@ int main(int argc, char *argv[]) case 'm': conf.crypt_name = EARGF(usage(1)); break; + case 'n': + not_found_is_ok = 1; + break; case 'd': dodebug = 1; break; @@ -1017,5 +1021,5 @@ int main(int argc, char *argv[]) conf.fork_count, event_count, total_bytes); - return found ? 0 : 1; + return found || not_found_is_ok ? 0 : 1; } |