diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-05-20 10:26:12 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-05-20 10:26:12 -0400 |
commit | c278c4dbcd0fc89f7baee4c82676e9deef780528 (patch) | |
tree | 593bb9af70cc84fc161f09b774a0f6f500670eff /src | |
parent | 67975a5944706e382fe1e7b00d226715c6242358 (diff) | |
download | stasis-c278c4dbcd0fc89f7baee4c82676e9deef780528.tar.gz |
Fix bad confict resolution
* Repairs linux build
Diffstat (limited to 'src')
-rw-r--r-- | src/copy.c | 2 | ||||
-rw-r--r-- | src/system.c | 71 | ||||
-rw-r--r-- | src/utils.c | 2 |
3 files changed, 2 insertions, 73 deletions
@@ -182,7 +182,7 @@ int copytree(const char *srcdir, const char *destdir, unsigned int op) { #if defined (OMC_OS_WINDOWS) is_dir = S_ISDIR(st.st_mode); #else - is_dir = DT_DIR == rec->d_type; + is_dir = DT_DIR == d->d_type; #endif if (is_dir) { if (strncmp(src, dest, strlen(src)) == 0) { diff --git a/src/system.c b/src/system.c index 895ed8a..773f9d7 100644 --- a/src/system.c +++ b/src/system.c @@ -13,77 +13,6 @@ int shell(struct Process *proc, char *args) { return system(cmd); } #else -int shell(struct Process *proc, char *args[]) { - FILE *fp_out, *fp_err; - pid_t pid; - pid_t status; - status = 0; - errno = 0; - - pid = fork(); - if (pid == -1) { - fprintf(stderr, "fork failed\n"); - exit(1); - } else if (pid == 0) { - int retval; - if (proc != NULL) { - if (strlen(proc->standard_output)) { - fp_out = freopen(proc->standard_output, "w+", stdout); - } - - if (strlen(proc->standard_error)) { - fp_err = freopen(proc->standard_error, "w+", stderr); - } - - if (proc->redirect_stderr) { - if (fp_err) { - fclose(fp_err); - fclose(stderr); - } - dup2(fileno(stdout), fileno(stderr)); - } - } - - retval = execv(args[0], args); - fprintf(stderr, "# executing: "); - for (size_t x = 0; args[x] != NULL; x++) { - fprintf(stderr, "%s ", args[x]); - } - - if (proc != NULL && strlen(proc->standard_output)) { - fflush(fp_out); - fclose(fp_out); - fflush(stdout); - fclose(stdout); - } - if (proc != NULL && strlen(proc->standard_error)) { - fflush(fp_err); - fclose(fp_err); - fflush(stderr); - fclose(stderr); - } - exit(retval); - } else { - if (waitpid(pid, &status, WUNTRACED) > 0) { - if (WIFEXITED(status) && WEXITSTATUS(status)) { - if (WEXITSTATUS(status) == 127) { - fprintf(stderr, "execv failed\n"); - } - } else if (WIFSIGNALED(status)) { - fprintf(stderr, "signal received: %d\n", WIFSIGNALED(status)); - } - } else { - fprintf(stderr, "waitpid() failed\n"); - } - } - - - if (proc != NULL) { - proc->returncode = status; - } - return WEXITSTATUS(status); -} - int shell(struct Process *proc, char *args) { FILE *fp_out = NULL; FILE *fp_err = NULL; diff --git a/src/utils.c b/src/utils.c index c62af08..b04aae6 100644 --- a/src/utils.c +++ b/src/utils.c @@ -58,7 +58,7 @@ int rmtree(char *_path) { stat(d_entity->d_name, &st); is_dir = S_ISDIR(st.st_mode); #else - is_dir = DT_DIR == rec->d_type; + is_dir = DT_DIR == d_entity->d_type; #endif // Push directories on to the stack first if (is_dir) { |