From c33dc593b2ff3a2a0b2800c3e4f35806bd5e89ae Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 16 Apr 2020 08:51:22 -0700 Subject: cpio: fix tests by removing --trailer. f2866cf58a07c9d681ecd6695ea969ac70e59a3d fixed the cpio --trailer check as it claimed to, but doing so changed our behavior (since it used to be always-on and is now off unless you supply --trailer). This broke one of the cpio tests. Since I can't find any other cpio that has a --trailer option (or its inverse), this patch removes --trailer. This reverts our behavior to our old behavior (always include the trailer). Judging by the fact that the cpio tests pass with TEST_HOST=1, this seems to be the expected behavior. --- toys/posix/cpio.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'toys') diff --git a/toys/posix/cpio.c b/toys/posix/cpio.c index eb76d6cf..64725c13 100644 --- a/toys/posix/cpio.c +++ b/toys/posix/cpio.c @@ -16,7 +16,7 @@ * rdevmajor rdevminor namesize check * This is the equiavlent of mode -H newc when using GNU CPIO. -USE_CPIO(NEWTOY(cpio, "(no-preserve-owner)(trailer)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]", TOYFLAG_BIN)) +USE_CPIO(NEWTOY(cpio, "(no-preserve-owner)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]", TOYFLAG_BIN)) config CPIO bool "cpio" @@ -34,7 +34,6 @@ config CPIO -t Test files (list only, stdin=archive, stdout=list of files) -v Verbose --no-preserve-owner (don't set ownership during extract) - --trailer Add legacy trailer (prevents concatenation) */ #define FOR_cpio @@ -274,11 +273,9 @@ void cpio_main(void) } free(name); - if (FLAG(trailer)) { - memset(toybuf, 0, sizeof(toybuf)); - xwrite(afd, toybuf, - sprintf(toybuf, "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0)+4); - } + memset(toybuf, 0, sizeof(toybuf)); + xwrite(afd, toybuf, + sprintf(toybuf, "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0)+4); } if (TT.F) xclose(afd); -- cgit v1.2.3