Browse Source

Nekofilter: Lookup python2, fail otherwise (but don't crash)

tags/1.9.4
falkTX 12 years ago
parent
commit
83d48ec94c
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      source/backend/native/nekofilter/ui.c

+ 10
- 2
source/backend/native/nekofilter/ui.c View File

@@ -343,6 +343,15 @@ nekoui_instantiate(
int i; int i;
char ch; char ch;


if (access("/usr/bin/python2", F_OK) != -1)
argv[0] = "/usr/bin/python2";
else if (access("/usr/bin/python2.7", F_OK) != -1)
argv[0] = "/usr/bin/python2.7";
else if (access("/usr/bin/python2.6", F_OK) != -1)
argv[0] = "/usr/bin/python2.6";
else
goto fail;

control_ptr = malloc(sizeof(struct control)); control_ptr = malloc(sizeof(struct control));
if (control_ptr == NULL) if (control_ptr == NULL)
{ {
@@ -383,7 +392,6 @@ nekoui_instantiate(


control_ptr->pid = -1; control_ptr->pid = -1;


argv[0] = "python2";
argv[1] = filename; argv[1] = filename;
argv[2] = sample_rate_str; argv[2] = sample_rate_str;
argv[3] = ui_recv_pipe; /* reading end */ argv[3] = ui_recv_pipe; /* reading end */
@@ -420,7 +428,7 @@ nekoui_instantiate(


execvp(argv[0], (char **)argv); execvp(argv[0], (char **)argv);
fprintf(stderr, "exec of UI failed: %s\n", strerror(errno)); fprintf(stderr, "exec of UI failed: %s\n", strerror(errno));
exit(1);
goto fail_free_control;
case -1: case -1:
fprintf(stderr, "fork() failed to create new process for plugin UI\n"); fprintf(stderr, "fork() failed to create new process for plugin UI\n");
goto fail_free_control; goto fail_free_control;


Loading…
Cancel
Save