diff options
author | Rob Landley <rob@landley.net> | 2018-08-31 15:02:21 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-08-31 15:14:12 -0500 |
commit | 8993496e496cdbc80643b69d049d05bbd7f596b3 (patch) | |
tree | 8790f2ada6dfdc0e98265672cac9b8ae07bfce56 /toys/posix/cpio.c | |
parent | 198b2b48345c175dc184258677fd48043dc1a78b (diff) | |
download | toybox-8993496e496cdbc80643b69d049d05bbd7f596b3.tar.gz |
Convert option style.
Diffstat (limited to 'toys/posix/cpio.c')
-rw-r--r-- | toys/posix/cpio.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/toys/posix/cpio.c b/toys/posix/cpio.c index 6ce3ef1c..f9da69e1 100644 --- a/toys/posix/cpio.c +++ b/toys/posix/cpio.c @@ -41,9 +41,7 @@ config CPIO #include "toys.h" GLOBALS( - char *archive; - char *pass; - char *fmt; + char *F, *p, *H; ) // Read strings, tail padded to 4 byte alignment. Argument "align" is amount @@ -87,7 +85,7 @@ void cpio_main(void) // In passthrough mode, parent stays in original dir and generates archive // to pipe, child does chdir to new dir and reads archive from stdin (pipe). - if (TT.pass) { + if (TT.p) { if (toys.stacktop) { // xpopen() doesn't return from child due to vfork(), instead restarts // with !toys.stacktop @@ -96,14 +94,14 @@ void cpio_main(void) } else { // child toys.optflags |= FLAG_i; - xchdir(TT.pass); + xchdir(TT.p); } } - if (TT.archive) { + if (TT.F) { int perm = (toys.optflags & FLAG_o) ? O_CREAT|O_WRONLY|O_TRUNC : O_RDONLY; - afd = xcreate(TT.archive, perm, 0644); + afd = xcreate(TT.F, perm, 0644); } // read cpio archive @@ -282,7 +280,7 @@ void cpio_main(void) sprintf(toybuf, "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0)+4); } } - if (TT.archive) xclose(afd); + if (TT.F) xclose(afd); - if (TT.pass) toys.exitval |= xpclose(pid, pipe); + if (TT.p) toys.exitval |= xpclose(pid, pipe); } |