Skip to content

Commit

Permalink
Support make commands that ignore errors
Browse files Browse the repository at this point in the history
  • Loading branch information
17451k committed Sep 10, 2018
1 parent 87a438d commit 517dd6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clade/libinterceptor/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static char *prepare_data(const char *path, char const *const argv[]) {

// Sometimes "path" contains incorrect values ("gcc" instead of "/usr/bin/gcc")
char *correct_path = NULL;
if (path == argv[0]) {
if (access(path, X_OK)) {
correct_path = which(path);
}

Expand Down
2 changes: 1 addition & 1 deletion clade/libinterceptor/interceptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int posix_spawn(pid_t *restrict pid, const char *restrict path, const posix_spaw
const posix_spawnattr_t *restrict attrp, char *const argv[restrict], char *const envp[restrict])
{
int (*posix_spawn_real)(pid_t *restrict, const char *restrict, const posix_spawn_file_actions_t *,
const posix_spawnattr_t *restrict, char *const *, char *const *) = dlsym(RTLD_NEXT, "posix_spawn");
const posix_spawnattr_t *restrict, char *const *restrict, char *const *restrict) = dlsym(RTLD_NEXT, "posix_spawn");

// DO NOT check if (! intercepted) here: it will result in command loss
if (access(path, F_OK ) != -1) {
Expand Down

0 comments on commit 517dd6d

Please sign in to comment.