3
0
Fork 0
forked from mirrors/nixpkgs

* Print an error if the exec fails.

svn path=/nixos/trunk/; revision=16732
This commit is contained in:
Eelco Dolstra 2009-08-16 16:46:00 +00:00
parent 3b931f7861
commit f31e2718b7

View file

@ -7,6 +7,8 @@
#include <fcntl.h>
#include <dirent.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
/* Make sure assertions are not compiled out. */
#undef NDEBUG
@ -71,6 +73,9 @@ int main(int argc, char * * argv)
//printf("real = %s, len = %d\n", real, len);
execve(real, argv, environ);
fprintf(stderr, "%s: cannot run `%s': %s\n",
argv[0], real, strerror(errno));
exit(1);
}