From a57aa83793f4e6fa6cc6515dda8c1029006d02c6 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sat, 12 Jan 2019 11:13:25 +0000 Subject: [PATCH] report error from system() calls that dont run cleanly - warn fix --- src/bin/e_desk.c | 3 ++- src/modules/sysinfo/cpuclock/cpuclock.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index eb675f0b4..1ea09647c 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -77,7 +77,8 @@ _do_profile(E_Desk *desk, E_Randr2_Screen *sc) "%s/enlightenment/utils/enlightenment_elm_cfgtool " "set %s %s 'scale-mul %i'", e_prefix_lib_get(), sc->config.profile, buf, scale); - system(buf2); + if (system(buf2) != 0) + ERR("Error code from trying to run \"%s\"", buf2); } } desk->window_profile = eina_stringshare_add(buf); diff --git a/src/modules/sysinfo/cpuclock/cpuclock.c b/src/modules/sysinfo/cpuclock/cpuclock.c index b950d1e06..938916e53 100644 --- a/src/modules/sysinfo/cpuclock/cpuclock.c +++ b/src/modules/sysinfo/cpuclock/cpuclock.c @@ -86,7 +86,8 @@ _cpuclock_set_governor(const char *governor) snprintf(buf, sizeof(buf), "%s %s %s", exe, "governor", governor); - system(buf); + if (system(buf) != 0) + ERR("Error code from trying to run \"%s\"", buf); } void @@ -104,14 +105,16 @@ _cpuclock_set_frequency(int frequency) e_module_dir_get(sysinfo_config->module), MODULE_ARCH); if (stat(exe, &st) < 0) return; snprintf(buf, sizeof(buf), "%s %d", exe, frequency); - system(buf); + if (system(buf) != 0) + ERR("Error code from trying to run \"%s\"", buf); #else snprintf(exe, 4096, "%s/%s/cpuclock_sysfs", e_module_dir_get(sysinfo_config->module), MODULE_ARCH); if (stat(exe, &st) < 0) return; snprintf(buf, sizeof(buf), "%s %s %i", exe, "frequency", frequency); - system(buf); + if (system(buf) != 0) + ERR("Error code from trying to run \"%s\"", buf); #endif } @@ -129,7 +132,8 @@ _cpuclock_set_pstate(int min, int max, int turbo) if (stat(exe, &st) < 0) return; snprintf(buf, sizeof(buf), "%s %s %i %i %i", exe, "pstate", min, max, turbo); - system(buf); + if (system(buf) != 0) + ERR("Error code from trying to run \"%s\"", buf); } static void