From: Radostin Stoyanov Date: Fri, 13 Apr 2018 06:01:45 +0000 (+0100) Subject: Remove redundant virFileIsExecutable check X-Git-Tag: v4.3.0-rc1~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=327ae930a4f833c038cd83ff06e216e697a83111;p=thirdparty%2Flibvirt.git Remove redundant virFileIsExecutable check Remove unnecessary virFileIsExecutable check after virFindFileInPath. Since the commit 9ae992f virFindFileInPath will reject non-executables. Signed-off-by: Radostin Stoyanov Signed-off-by: Michal Privoznik --- diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index 381cc0de37..e13085b1d5 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -179,8 +179,6 @@ virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps) binary = virFindFileInPath("grub-bhyve"); if (binary == NULL) goto out; - if (!virFileIsExecutable(binary)) - goto out; cmd = virCommandNew(binary); virCommandAddArg(cmd, "--help"); @@ -315,8 +313,6 @@ virBhyveProbeCaps(unsigned int *caps) binary = virFindFileInPath("bhyve"); if (binary == NULL) goto out; - if (!virFileIsExecutable(binary)) - goto out; if ((ret = bhyveProbeCapsRTC_UTC(caps, binary))) goto out; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 27180e8509..c8488f875d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -649,16 +649,10 @@ virQEMUCapsFindBinary(const char *format, char *binary = NULL; if (virAsprintf(&binary, format, archstr) < 0) - goto out; + return NULL; ret = virFindFileInPath(binary); VIR_FREE(binary); - if (ret && virFileIsExecutable(ret)) - goto out; - - VIR_FREE(ret); - - out: return ret; }