aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/cp.c4
-rw-r--r--toys/posix/mkdir.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index ddbfe125..3b30f8a8 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -494,7 +494,7 @@ void install_main(void)
if (flags & FLAG_d) {
for (ss = toys.optargs; *ss; ss++) {
- if (mkpathat(AT_FDCWD, *ss, 0777, 3)) perror_msg_raw(*ss);
+ if (mkpathat(AT_FDCWD, *ss, 0777, MKPATHAT_MKLAST | MKPATHAT_MAKE)) perror_msg_raw(*ss);
if (flags & (FLAG_g|FLAG_o))
if (lchown(*ss, TT.uid, TT.gid)) perror_msg("chown '%s'", *ss);
if (flags & FLAG_v) printf("%s\n", *ss);
@@ -505,7 +505,7 @@ void install_main(void)
if (toys.optflags & FLAG_D) {
TT.destname = toys.optargs[toys.optc-1];
- if (mkpathat(AT_FDCWD, TT.destname, 0, 2))
+ if (mkpathat(AT_FDCWD, TT.destname, 0, MKPATHAT_MAKE))
perror_exit("-D '%s'", TT.destname);
if (toys.optc == 1) return;
}
diff --git a/toys/posix/mkdir.c b/toys/posix/mkdir.c
index abb33db4..770300d4 100644
--- a/toys/posix/mkdir.c
+++ b/toys/posix/mkdir.c
@@ -48,7 +48,7 @@ void mkdir_main(void)
// Note, -p and -v flags line up with mkpathat() flags
for (s=toys.optargs; *s; s++) {
- if (mkpathat(AT_FDCWD, *s, mode, toys.optflags|1))
+ if (mkpathat(AT_FDCWD, *s, mode, toys.optflags|MKPATHAT_MKLAST))
perror_msg("'%s'", *s);
}
}