Skip to content

Commit

Permalink
execve: return errno if set ow ENOENT (#51)
Browse files Browse the repository at this point in the history
Also include spawn.h as "spawn.h" to indicate it's from zoslib.
  • Loading branch information
gabylb authored Feb 5, 2024
1 parent 4deb33b commit 36b8227
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/zos-spawn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//// or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
/////////////////////////////////////////////////////////////////////////////////

#include <spawn.h>
#include "spawn.h"
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
Expand Down Expand Up @@ -237,7 +237,8 @@ int posix_spawn(pid_t *pid, const char *path,
}
}
execve(path, args, env);
return ENOENT;
rc = errno;
return rc != 0 ? rc : ENOENT;
}
return 0;
}
Expand Down

0 comments on commit 36b8227

Please sign in to comment.