]> git.mdlowis.com Git - projs/tide.git/commitdiff
removed unused parameters from blocking command execution
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 20 Mar 2018 02:27:45 +0000 (22:27 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 20 Mar 2018 02:27:45 +0000 (22:27 -0400)
inc/edit.h
lib/exec.c
tide.c

index f3f47e71d570434458d4928c0a5653f5f6cec288..b36232a1099bc0901405c9d45f921809277ad809 100644 (file)
@@ -228,7 +228,7 @@ Rune view_getrune(View* view);
  *****************************************************************************/
 bool exec_reap(void);
 void exec_job(char** cmd, char* data, size_t ndata, View* dest);
-int exec_cmd(char** cmd, char* text, char** out, char** err);
+int exec_cmd(char** cmd);
 int exec_spawn(char** cmd, int* in, int* out);
 
 /* Pseudo-Terminal Handling
index 6072dd85818df87f2617bad7bc9ba11926e814ed..4e014f88426b6536170a827a15e1c958b0348959 100644 (file)
@@ -93,24 +93,12 @@ void exec_job(char** cmd, char* data, size_t ndata, View* dest) {
     }
 }
 
-int exec_cmd(char** cmd, char* text, char** out, char** err) {
+int exec_cmd(char** cmd) {
     Proc proc;
     if (execute(cmd, &proc) < 0) {
         perror("failed to execute");
         return -1;
     }
-    /* send the input to stdin of the command */
-    if (text && write(proc.in, text, strlen(text)) < 0) {
-        perror("failed to write");
-        return -1;
-    }
-    close(proc.in);
-    /* read the stderr of the command */
-    if (err) *err = fdgets(proc.err);
-    close(proc.err);
-    /* read the stdout of the command */
-    if (out) *out = fdgets(proc.out);
-    close(proc.out);
     /* wait for the process to finish */
     int status;
     waitpid(proc.pid, &status, 0);
diff --git a/tide.c b/tide.c
index 612c67d5c4e1d8283938281ee4fd443c50fe9ea6..221d541a2137e8dfd68e38f1e7a0ef927006eb48 100644 (file)
--- a/tide.c
+++ b/tide.c
@@ -213,7 +213,7 @@ void onmouseright(WinRegion id, bool pressed, size_t row, size_t col) {
     } else {
         char* text = view_fetch(win_view(id), row, col, risfile);
         FetchCmd[1] = text;
-        if (exec_cmd(FetchCmd, NULL, NULL, NULL) != 0) {
+        if (exec_cmd(FetchCmd) != 0) {
             SearchDir *= (x11_keymodsset(ModShift) ? -1 : +1);
             free(SearchTerm);
             SearchTerm = view_fetch(win_view(id), row, col, risfile);