ref: 18606801f741a34affbd0628737417daadd0c620
parent: 5fc705baf54b1a0b8e35c22f0e4dd7fab0162aad
author: Natanael Copa <ncopa@alpinelinux.org>
date: Mon Jan 18 04:04:04 CST 2016
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.
--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -840,6 +840,7 @@
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 @@
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 @@
conf.fork_count,
event_count, total_bytes);
- return found ? 0 : 1;
+ return found || not_found_is_ok ? 0 : 1;
}