Remove redundant virFileIsExecutable check

Remove unnecessary virFileIsExecutable check after virFindFileInPath.
Since the commit 9ae992f virFindFileInPath will reject non-executables.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Radostin Stoyanov 2018-04-13 07:01:45 +01:00 committed by Michal Privoznik
parent 65a372d6e0
commit 327ae930a4
2 changed files with 1 additions and 11 deletions

View File

@ -179,8 +179,6 @@ virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps)
binary = virFindFileInPath("grub-bhyve"); binary = virFindFileInPath("grub-bhyve");
if (binary == NULL) if (binary == NULL)
goto out; goto out;
if (!virFileIsExecutable(binary))
goto out;
cmd = virCommandNew(binary); cmd = virCommandNew(binary);
virCommandAddArg(cmd, "--help"); virCommandAddArg(cmd, "--help");
@ -315,8 +313,6 @@ virBhyveProbeCaps(unsigned int *caps)
binary = virFindFileInPath("bhyve"); binary = virFindFileInPath("bhyve");
if (binary == NULL) if (binary == NULL)
goto out; goto out;
if (!virFileIsExecutable(binary))
goto out;
if ((ret = bhyveProbeCapsRTC_UTC(caps, binary))) if ((ret = bhyveProbeCapsRTC_UTC(caps, binary)))
goto out; goto out;

View File

@ -649,16 +649,10 @@ virQEMUCapsFindBinary(const char *format,
char *binary = NULL; char *binary = NULL;
if (virAsprintf(&binary, format, archstr) < 0) if (virAsprintf(&binary, format, archstr) < 0)
goto out; return NULL;
ret = virFindFileInPath(binary); ret = virFindFileInPath(binary);
VIR_FREE(binary); VIR_FREE(binary);
if (ret && virFileIsExecutable(ret))
goto out;
VIR_FREE(ret);
out:
return ret; return ret;
} }