]> granicus.if.org Git - graphviz/commitdiff
Xlib plugin: remove unused 'err' variable
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 5 Mar 2022 18:27:55 +0000 (10:27 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Mar 2022 05:28:32 +0000 (21:28 -0800)
The return value of `execvp` is irrelevant because this function only ever
returns when it fails. In this situation, the failure cause is in the `errno`
global, not in the return value.

plugin/xlib/gvdevice_xlib.c

index 1ed26503feeb37f498696dac67e2983d880046e8..13a2d39894d15445f042348fb538debfb332b4f3 100644 (file)
@@ -148,7 +148,6 @@ static void browser_show(GVJ_t *job)
 #if defined HAVE_SYS_TYPES_H && defined HAVE_UNISTD_H
    char *exec_argv[3] = {BROWSER, NULL, NULL};
    pid_t pid;
-   int err;
 
    exec_argv[1] = job->selected_href;
 
@@ -157,7 +156,7 @@ static void browser_show(GVJ_t *job)
        fprintf(stderr,"fork failed: %s\n", strerror(errno));
    }
    else if (pid == 0) {
-       err = execvp(exec_argv[0], exec_argv);
+       execvp(exec_argv[0], exec_argv);
        fprintf(stderr,"error starting %s: %s\n", exec_argv[0], strerror(errno));
    }
 #else