From 88d1fe630dc6aec3ba0f27cf241eebdba5635871 Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Sat, 16 May 2020 12:12:09 +0100 Subject: [PATCH] kvm: Reduce levels of indentation. --- src/bin/system/process.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/bin/system/process.c b/src/bin/system/process.c index 409660d..24b2be5 100644 --- a/src/bin/system/process.c +++ b/src/bin/system/process.c @@ -796,25 +796,22 @@ _cmd_get(Proc_Info *p, struct kinfo_proc *kp) Eina_Bool have_command = EINA_FALSE; kern = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, "kvm_open"); - if (kern != NULL) + if (kern) { - if ((args = kvm_getargv(kern, kp, sizeof(name)-1))) + if ((args = kvm_getargv(kern, kp, sizeof(name)-1)) && (args[0])) { - if (args[0]) + char *base = strdup(args[0]); + if (base) { - char *base = strdup(args[0]); - if (base) - { - char *spc = strchr(base, ' '); - if (spc) *spc = '\0'; + char *spc = strchr(base, ' '); + if (spc) *spc = '\0'; - if (ecore_file_exists(base)) - { - snprintf(name, sizeof(name), "%s", basename(base)); - have_command = EINA_TRUE; - } - free(base); + if (ecore_file_exists(base)) + { + snprintf(name, sizeof(name), "%s", basename(base)); + have_command = EINA_TRUE; } + free(base); } Eina_Strbuf *buf = eina_strbuf_new(); for (int i = 0; args[i] != NULL; i++)