From 221439164eb6683a5af35540b24b5620e5d8ab19 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 8 Apr 2018 22:12:08 -0500 Subject: Add mkpath() for common case of mkpathat(), and #define magic constants. --- toys/posix/patch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'toys/posix/patch.c') diff --git a/toys/posix/patch.c b/toys/posix/patch.c index fbad1fb9..181af2a1 100644 --- a/toys/posix/patch.c +++ b/toys/posix/patch.c @@ -397,8 +397,7 @@ void patch_main(void) if ((!strcmp(oldname, "/dev/null") || !oldsum) && access(name, F_OK)) { printf("creating %s\n", name); - if (mkpathat(AT_FDCWD, name, 0, 2)) - perror_exit("mkpath %s", name); + if (mkpath(name)) perror_exit("mkpath %s", name); TT.filein = xcreate(name, O_CREAT|O_EXCL|O_RDWR, 0666); } else { printf("patching %s\n", name); -- cgit v1.2.3