Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Pass the exit code correctly

  • Loading branch information...
commit e8feb8eaeca4589b791dac91d8236ded27fa841b 1 parent c4f5922
@tdudziak authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 capbound.c
View
9 capbound.c
@@ -115,6 +115,11 @@ main(int argc, char** argv)
}
drop_capabilities(capspec);
- execvp(argv[optind], &argv[optind]);
- return EXIT_SUCCESS; /* unreachable */
+
+ if (execvp(argv[optind], &argv[optind]) < 0) {
+ perror("Cannot execute given command");
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_FAILURE; /* unreachable */
}
Please sign in to comment.
Something went wrong with that request. Please try again.