Module Name: src Committed By: christos Date: Mon Apr 1 02:20:52 UTC 2024
Modified Files: src/usr.bin/gzip: gzip.c Log Message: - -n is the default on SMALL, so accept the flag silently. - conditionalize TIMESPEC_TO_TIMEVAL - add nbtool_config.h To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/usr.bin/gzip/gzip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/gzip/gzip.c diff -u src/usr.bin/gzip/gzip.c:1.122 src/usr.bin/gzip/gzip.c:1.123 --- src/usr.bin/gzip/gzip.c:1.122 Sat Feb 3 17:40:29 2024 +++ src/usr.bin/gzip/gzip.c Sun Mar 31 22:20:52 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.122 2024/02/03 22:40:29 mrg Exp $ */ +/* $NetBSD: gzip.c,v 1.123 2024/04/01 02:20:52 christos Exp $ */ /* * Copyright (c) 1997-2024 Matthew R. Green @@ -26,11 +26,15 @@ * SUCH DAMAGE. */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <sys/cdefs.h> #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1997-2024 Matthew R. Green. " "All rights reserved."); -__RCSID("$NetBSD: gzip.c,v 1.122 2024/02/03 22:40:29 mrg Exp $"); +__RCSID("$NetBSD: gzip.c,v 1.123 2024/04/01 02:20:52 christos Exp $"); #endif /* not lint */ /* @@ -337,7 +341,7 @@ main(int argc, char **argv) dflag = cflag = 1; #ifdef SMALL -#define OPT_LIST "123456789cdhlV" +#define OPT_LIST "123456789cdhlVn" #else #define OPT_LIST "123456789cdfhklNnqrS:tVv" #endif @@ -403,6 +407,9 @@ main(int argc, char **argv) case 'v': vflag = 1; break; +#else + case 'n': + break; #endif default: usage(); @@ -1113,6 +1120,7 @@ copymodes(int fd, const struct stat *sbp if (fchmod(fd, sb.st_mode) < 0) maybe_warn("couldn't fchmod: %s", file); +#ifdef TIMESPEC_TO_TIMEVAL TIMESPEC_TO_TIMEVAL(×[0], &sb.st_atimespec); TIMESPEC_TO_TIMEVAL(×[1], &sb.st_mtimespec); if (futimes(fd, times) < 0) @@ -1121,6 +1129,7 @@ copymodes(int fd, const struct stat *sbp /* finally, only try flags if they exist already */ if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0) maybe_warn("couldn't fchflags: %s", file); +#endif } #endif