Skip to content

Commit

Permalink
Make tup monitor use the correct executable
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanolofsson committed Aug 30, 2024
1 parent 4247a52 commit f56af3b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tup/monitor/inotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,14 @@ static int autoupdate(const char *cmd)
}
}
args[update_argc+3] = NULL;
execvp("tup", args);
char path[1024];
ssize_t len = readlink("/proc/self/exe", path, sizeof(path) - 1);
if (len != -1) {
path[len] = '\0'; // Null-terminate the string
} else {
perror("readlink");
}
execvp(path, args);
perror("execvp");
exit(1);
} else {
Expand Down

0 comments on commit f56af3b

Please sign in to comment.