diff --git a/cmds/subvolume.c b/cmds/subvolume.c index 8da64d31..ff0ef2f3 100644 --- a/cmds/subvolume.c +++ b/cmds/subvolume.c @@ -137,7 +137,7 @@ static int cmd_subvol_create(const struct cmd_struct *cmd, dst = argv[optind]; retval = 1; /* failure */ - res = test_isdir(dst); + res = path_is_dir(dst); if (res < 0 && res != -ENOENT) { errno = -res; error("cannot access %s: %m", dst); @@ -697,7 +697,7 @@ static int cmd_subvol_snapshot(const struct cmd_struct *cmd, goto out; } - res = test_isdir(dst); + res = path_is_dir(dst); if (res < 0 && res != -ENOENT) { errno = -res; error("cannot access %s: %m", dst); diff --git a/common/path-utils.c b/common/path-utils.c index 357df508..175da572 100644 --- a/common/path-utils.c +++ b/common/path-utils.c @@ -362,7 +362,7 @@ char *__strncpy_null(char *dest, const char *src, size_t n) * 1 - path exists and it is a directory * < 0 - error */ -int test_isdir(const char *path) +int path_is_dir(const char *path) { struct stat st; int ret; diff --git a/common/path-utils.h b/common/path-utils.h index 279d88d6..0cabcb7d 100644 --- a/common/path-utils.h +++ b/common/path-utils.h @@ -32,10 +32,10 @@ int path_is_block_device(const char *file); int path_is_mount_point(const char *file); int path_exists(const char *file); int path_is_reg_file(const char *path); +int path_is_dir(const char *path); int is_same_loop_file(const char *a, const char *b); int path_is_reg_or_block_device(const char *filename); int test_issubvolname(const char *name); -int test_isdir(const char *path); #endif