From f3a4f62a08632c31fb095f86d1eaa8370dd187bf Mon Sep 17 00:00:00 2001 From: Juha Sointusalo Date: Tue, 9 Oct 2018 21:24:12 +0300 Subject: [PATCH] scr: fix argv in calls to run_program() argv is supposed to be Unix-style and in Unix-style argv[0] is program name. Let's try to have it that way. Also clean up a comment that is not relevant to Windows code path. --- clientscr/screensaver.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/clientscr/screensaver.cpp b/clientscr/screensaver.cpp index 37ab545b40..b02f56228b 100644 --- a/clientscr/screensaver.cpp +++ b/clientscr/screensaver.cpp @@ -243,7 +243,7 @@ int CScreensaver::launch_screensaver(RESULT* rp, GFXAPP_ID& graphics_application } #else char* argv[3]; - argv[0] = "app_graphics"; // not used + argv[0] = rp->graphics_exec_path; argv[1] = "--fullscreen"; argv[2] = 0; retval = run_program( @@ -392,10 +392,6 @@ int CScreensaver::launch_default_screensaver(char *dir_path, GFXAPP_ID& graphics BOINCTRACE(_T("launch_default_screensaver returned %d\n"), retval); #else - // For unknown reasons, the graphics application exits with - // "RegisterProcess failed (error = -50)" unless we pass its - // full path twice in the argument list to execv on Macs. - char* argv[4]; char full_path[1024]; @@ -403,7 +399,7 @@ int CScreensaver::launch_default_screensaver(char *dir_path, GFXAPP_ID& graphics strlcat(full_path, PATH_SEPARATOR, sizeof(full_path)); strlcat(full_path, THE_DEFAULT_SS_EXECUTABLE, sizeof(full_path)); - argv[0] = full_path; // not used + argv[0] = full_path; argv[1] = "--fullscreen"; argv[2] = 0; argv[3] = 0;