diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-04-24 15:02:11 +0200 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2024-06-18 22:59:43 +0200 |
commit | 3db000a5399fd688ec0d97b38e784778bdd90375 (patch) | |
tree | 5a47332b2046084e5b9c6b15a55a229347966e05 /src | |
parent | 3501a50ffb93756e145295021ff9313ac77f1ba9 (diff) | |
download | unit-3db000a5399fd688ec0d97b38e784778bdd90375.tar.gz unit-3db000a5399fd688ec0d97b38e784778bdd90375.tar.bz2 |
fs: Rename nxt_fs_mkdir_parent() => nxt_fs_mkdir_dirname()
"dirname" is the usual way to refer to the directory part of a path
name. See for example dirname(1), or the dirname builtin in several
languages. Also, in the context of mkdir(), "parents" is used to refer
to mkdir -p, which is too similar to "parent", so it can lead to
confusion.
Tested-by: Andy Postnikov <apostnikov@gmail.com>
Tested-by: Andrew Clayton <a.clayton@nginx.com>
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/nxt_controller.c | 2 | ||||
-rw-r--r-- | src/nxt_fs.c | 2 | ||||
-rw-r--r-- | src/nxt_fs.h | 2 | ||||
-rw-r--r-- | src/nxt_runtime.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/nxt_controller.c b/src/nxt_controller.c index 30d5f04e..109324b8 100644 --- a/src/nxt_controller.c +++ b/src/nxt_controller.c @@ -695,7 +695,7 @@ nxt_runtime_controller_socket(nxt_task_t *task, nxt_runtime_t *rt) if (ls->sockaddr->u.sockaddr.sa_family == AF_UNIX) { const char *path = ls->sockaddr->u.sockaddr_un.sun_path; - nxt_fs_mkdir_parent((const u_char *) path, 0755); + nxt_fs_mkdir_dirname((const u_char *) path, 0755); } #endif diff --git a/src/nxt_fs.c b/src/nxt_fs.c index e10c5bcb..f8d872f5 100644 --- a/src/nxt_fs.c +++ b/src/nxt_fs.c @@ -49,7 +49,7 @@ nxt_fs_mkdir_all(const u_char *dir, mode_t mode) nxt_int_t -nxt_fs_mkdir_parent(const u_char *path, mode_t mode) +nxt_fs_mkdir_dirname(const u_char *path, mode_t mode) { char *ptr, *dir; nxt_int_t ret; diff --git a/src/nxt_fs.h b/src/nxt_fs.h index c8868d80..3ee0928c 100644 --- a/src/nxt_fs.h +++ b/src/nxt_fs.h @@ -6,7 +6,7 @@ #define _NXT_FS_H_INCLUDED_ -nxt_int_t nxt_fs_mkdir_parent(const u_char *path, mode_t mode); +nxt_int_t nxt_fs_mkdir_dirname(const u_char *path, mode_t mode); nxt_int_t nxt_fs_mkdir_all(const u_char *dir, mode_t mode); diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c index 0e7f879e..b368647e 100644 --- a/src/nxt_runtime.c +++ b/src/nxt_runtime.c @@ -1490,7 +1490,7 @@ nxt_runtime_pid_file_create(nxt_task_t *task, nxt_file_name_t *pid_file) file.name = pid_file; - nxt_fs_mkdir_parent(pid_file, 0755); + nxt_fs_mkdir_dirname(pid_file, 0755); n = nxt_file_open(task, &file, O_WRONLY, O_CREAT | O_TRUNC, NXT_FILE_DEFAULT_ACCESS); |