From 36ff0e5a191eb868cfaf402a65880b69e57727db Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Tue, 15 Feb 2022 09:17:47 +0100 Subject: [PATCH] actions.c: Drop elaborate GSOD messages on ipc exec errors --- src/actions.c | 81 ++++++--------------------------------------------- src/edebug.h | 3 +- 2 files changed, 11 insertions(+), 73 deletions(-) diff --git a/src/actions.c b/src/actions.c index 4901ed42..1c166476 100644 --- a/src/actions.c +++ b/src/actions.c @@ -89,7 +89,6 @@ EspawnApplication(const char *params, int flags) { char exe[FILEPATH_LEN_MAX]; const char *sh; - char *path; char *real_exec; if (!params) @@ -99,6 +98,9 @@ EspawnApplication(const char *params, int flags) if (exe[0] == '\0') return -1; + if (EDebug(EDBUG_TYPE_EXEC)) + Eprintf("%s: '%s'\n", __func__, params); + Mode.apps.startup_id++; if (fork()) return 0; @@ -120,76 +122,9 @@ EspawnApplication(const char *params, int flags) } if (!Mode.wm.startup) - { - path = path_test(exe, EFILE_ANY); - if (!path) - { - /* absolute path */ - if (isabspath(exe)) - AlertOK(_("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file does not exist.\n"), exe); - /* relative path */ - else - AlertOK(_("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is most probably because this " - "program is not in the\n" - "path for your shell which is %s. " - "I suggest you read the manual\n" - "page for that shell and read up how to " - "change or add to your\n" - "execution path.\n"), exe, sh); - } - else - /* it is a node on the filing sys */ - { - /* it's a file */ - if (isfile(path)) - { - /* can execute it */ - if (canexec(path)) - AlertOK(_("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "I am unsure as to why you could not " - "do this. The file exists,\n" - "is a file, and you are allowed to " - "execute it. I suggest you look\n" - "into this.\n"), path); - /* not executable file */ - else - AlertOK(_("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file exists, is a " - "file, but you are unable\n" - "to execute it because you do not " - "have execute " "access to this file.\n"), path); - } - /* it's not a file */ - else - { - /* its a dir */ - if (isdir(path)) - AlertOK(_("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file is in fact " - "a directory.\n"), path); - /* its not a file or a dir */ - else - AlertOK(_("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file is not a " - "regular file.\n"), path); - } - Efree(path); - } - } + AlertOK(_("There was a problem running the command\n '%s'\nError: %m"), + params); + exit(100); } @@ -206,7 +141,9 @@ _Espawn(int argc __UNUSED__, char **argv) execvp(argv[0], argv); - AlertOK(_("There was an error running the program:\n%s"), argv[0]); + AlertOK(_("There was a problem running the command\n '%s'\nError: %m"), + argv[0]); + exit(100); } diff --git a/src/edebug.h b/src/edebug.h index 7d6c083b..d0e8b300 100644 --- a/src/edebug.h +++ b/src/edebug.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2021 Kim Woelders + * Copyright (C) 2006-2022 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -58,6 +58,7 @@ #define EDBUG_TYPE_ZOOM 154 #define EDBUG_TYPE_ANIM 155 #define EDBUG_TYPE_PRESENT 156 +#define EDBUG_TYPE_EXEC 157 #define EDBUG_TYPE_COMPMGR 161 #define EDBUG_TYPE_COMPMGR2 162