From e57cd5ae855aa97593d0952394b2b18c7cf6aac4 Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 22 Feb 2021 09:46:05 +0000 Subject: [PATCH] Rename mkpath() to mkpathat() since it uses mkdirat() internally. --- usr.sbin/rpki-client/extern.h | 4 ++-- usr.sbin/rpki-client/main.c | 4 ++-- usr.sbin/rpki-client/mkdir.c | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/usr.sbin/rpki-client/extern.h b/usr.sbin/rpki-client/extern.h index ef0106fba73..fb71c6d8fa5 100644 --- a/usr.sbin/rpki-client/extern.h +++ b/usr.sbin/rpki-client/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.46 2021/02/19 08:14:49 claudio Exp $ */ +/* $OpenBSD: extern.h,v 1.47 2021/02/22 09:46:05 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -449,7 +449,7 @@ int output_json(FILE *, struct vrp_tree *, struct stats *); void logx(const char *fmt, ...) __attribute__((format(printf, 1, 2))); -int mkpath(int, const char *); +int mkpathat(int, const char *); #define RPKI_PATH_OUT_DIR "/var/db/rpki-client" #define RPKI_PATH_BASE_DIR "/var/cache/rpki-client" diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c index cf4e154db70..19a8fd02274 100644 --- a/usr.sbin/rpki-client/main.c +++ b/usr.sbin/rpki-client/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.103 2021/02/19 12:18:23 tb Exp $ */ +/* $OpenBSD: main.c,v 1.104 2021/02/22 09:46:05 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -297,7 +297,7 @@ repo_fetch(struct repo *rp) * will not build the destination for us. */ - if (mkpath(cachefd, rp->local) == -1) + if (mkpathat(cachefd, rp->local) == -1) err(1, "%s", rp->local); logx("%s: pulling from network", rp->local); diff --git a/usr.sbin/rpki-client/mkdir.c b/usr.sbin/rpki-client/mkdir.c index 7369c3de4c5..e9a349feef6 100644 --- a/usr.sbin/rpki-client/mkdir.c +++ b/usr.sbin/rpki-client/mkdir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkdir.c,v 1.2 2021/02/19 08:14:49 claudio Exp $ */ +/* $OpenBSD: mkdir.c,v 1.3 2021/02/22 09:46:05 claudio Exp $ */ /* * Copyright (c) 1983, 1992, 1993 @@ -37,13 +37,14 @@ #include "extern.h" /* - * mkpath -- create directories. + * mkpathat -- create directories. + * dirfd - file descriptor for local directory * path - path * mode - file mode of terminal directory * dir_mode - file mode of intermediate directories */ int -mkpath(int dirfd, const char *dir) +mkpathat(int dirfd, const char *dir) { char *path, *slash; int done; -- 2.20.1