diff options
author | Hadrian Węgrzynowski <hadrian@hawski.com> | 2019-03-12 21:29:40 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-03-13 14:16:50 -0500 |
commit | d28cfa561cfb6144746b04fd53e9294fdd66781e (patch) | |
tree | 3b1a320120bee358fd10104867d07a53cafead0d /toys/posix | |
parent | e889a27376f96735a7e5fde820e1f98e2a6eff90 (diff) | |
download | toybox-d28cfa561cfb6144746b04fd53e9294fdd66781e.tar.gz |
Use defined constants for mkpathat.
Diffstat (limited to 'toys/posix')
-rw-r--r-- | toys/posix/cp.c | 4 | ||||
-rw-r--r-- | toys/posix/mkdir.c | 2 |
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); } } |