From b98a984f0bb2c18ec181a385a0783d2b98b73e77 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 2 Jul 2019 00:10:42 +0200 Subject: [PATCH] btrfs-progs: path-utils: rename test_isdir Rename so it follows the path_ conventions. Signed-off-by: David Sterba --- cmds/subvolume.c | 4 ++-- common/path-utils.c | 2 +- common/path-utils.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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