* Print an error if the exec fails.
svn path=/nixos/trunk/; revision=16732
This commit is contained in:
parent
3b931f7861
commit
f31e2718b7
@ -7,6 +7,8 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
/* Make sure assertions are not compiled out. */
|
/* Make sure assertions are not compiled out. */
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
@ -71,6 +73,9 @@ int main(int argc, char * * argv)
|
|||||||
//printf("real = %s, len = %d\n", real, len);
|
//printf("real = %s, len = %d\n", real, len);
|
||||||
|
|
||||||
execve(real, argv, environ);
|
execve(real, argv, environ);
|
||||||
|
|
||||||
|
fprintf(stderr, "%s: cannot run `%s': %s\n",
|
||||||
|
argv[0], real, strerror(errno));
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user