libmisc/btrfs: no sense trying to calculate 'btrfs' string

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
This commit is contained in:
Serge Hallyn 2019-05-03 19:40:02 -07:00
parent 51cfc1f89a
commit aff40d8515

View File

@ -32,7 +32,7 @@ static int run_btrfs_subvolume_cmd(const char *subcmd, const char *arg1, const c
int status = 0;
const char *cmd = btrfs_cmd();
const char *argv[] = {
strrchr(cmd, '/'),
"btrfs",
"subvolume",
subcmd,
arg1,
@ -40,11 +40,6 @@ static int run_btrfs_subvolume_cmd(const char *subcmd, const char *arg1, const c
NULL
};
if (argv[0] == NULL)
argv[0] = cmd;
else
argv[0] = argv[0] + 1;
if (access(cmd, X_OK)) {
return 1;
}