find: fix spurious -exec error messages

(bug reported by Bernhard Fischer <rep.nop@aon.at>)
This commit is contained in:
Denis Vlasenko
2006-12-23 00:49:10 +00:00
parent 4cccc03768
commit 8f6c79240d
2 changed files with 8 additions and 4 deletions

View File

@@ -197,9 +197,8 @@ ACTF(exec)
for (i = 0; i < ap->exec_argc; i++)
argv[i] = subst(ap->exec_argv[i], ap->subst_count[i], fileName);
argv[i] = NULL; /* terminate the list */
errno = 0;
rc = wait4pid(spawn(argv));
if (errno)
if (rc)
bb_perror_msg("%s", argv[0]);
for (i = 0; i < ap->exec_argc; i++)
free(argv[i]);