better execv in cpp

This commit is contained in:
Barak Michener 2013-08-31 22:37:51 -04:00
parent 5a36066325
commit 187127a646

2
tpm.cc
View file

@ -162,7 +162,7 @@ int DaemonMain(int countdown_time) {
printf("%s\n", local.sun_path);
unlink(local.sun_path);
string post_hook = MakePostHookPath();
char* argv[0];
char* argv[] = {(char *)post_hook.c_str(), NULL};
if (access(post_hook.c_str(), X_OK) != -1) {
execv(post_hook.c_str(), argv);
}