From 18606801f741a34affbd0628737417daadd0c620 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 18 Jan 2016 10:04:04 +0100 Subject: 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. --- nlplug-findfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3