aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-10-08 20:06:21 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-10-08 20:06:21 +0200
commit2aeed4fdf55d94f2fdb08107108a3e79fda1aee9 (patch)
tree2802840b4bbe06b4ce8a59d113d678a5b2a8e4b2
parent567d60c3af74d0ac4d9d2ed91d0f548963ce9693 (diff)
downloadmkinitfs-2aeed4fdf55d94f2fdb08107108a3e79fda1aee9.tar.bz2
mkinitfs-2aeed4fdf55d94f2fdb08107108a3e79fda1aee9.tar.xz
nlplug-findfs: fix exit code
retun success if anything of what we searched for was found.
-rw-r--r--nlplug-findfs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/nlplug-findfs.c b/nlplug-findfs.c
index bf2a2ad..e07cff6 100644
--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -617,7 +617,7 @@ int main(int argc, char *argv[])
struct ueventconf conf;
int event_count = 0;
size_t total_bytes;
- int ret = 1, found = 0;
+ int found = 0;
char *program_argv[2] = {0,0};
pthread_t tid;
@@ -722,10 +722,8 @@ int main(int argc, char *argv[])
found |= process_uevent(buf, len, &conf);
if ((found & FOUND_DEVICE)
- || ((found & FOUND_BOOTREPO) && (found & FOUND_APKOVL))) {
- ret = 0;
+ || ((found & FOUND_BOOTREPO) && (found & FOUND_APKOVL)))
break;
- }
if (fds[0].revents & POLLHUP) {
dbg("parent hung up\n");
@@ -742,7 +740,7 @@ int main(int argc, char *argv[])
conf.fork_count,
event_count, total_bytes);
- return ret;
+ return found ? 0 : 1;
}