Module Name: src Committed By: christos Date: Mon Apr 1 22:20:58 UTC 2024
Modified Files: src/usr.bin/gzip: gzip.c Log Message: Handle not having SIGINFO (Jan-Benedict Glaw) To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 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.123 src/usr.bin/gzip/gzip.c:1.124 --- src/usr.bin/gzip/gzip.c:1.123 Sun Mar 31 22:20:52 2024 +++ src/usr.bin/gzip/gzip.c Mon Apr 1 18:20:58 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.123 2024/04/01 02:20:52 christos Exp $ */ +/* $NetBSD: gzip.c,v 1.124 2024/04/01 22:20:58 christos Exp $ */ /* * Copyright (c) 1997-2024 Matthew R. Green @@ -34,7 +34,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1997-2024 Matthew R. Green. " "All rights reserved."); -__RCSID("$NetBSD: gzip.c,v 1.123 2024/04/01 02:20:52 christos Exp $"); +__RCSID("$NetBSD: gzip.c,v 1.124 2024/04/01 22:20:58 christos Exp $"); #endif /* not lint */ /* @@ -192,7 +192,9 @@ static int qflag; /* quiet mode */ static int rflag; /* recursive mode */ static int tflag; /* test */ static int vflag; /* verbose mode */ +#ifdef SIGINFO static sig_atomic_t print_info = 0; +#endif #else #define qflag 0 #define tflag 0 @@ -244,7 +246,11 @@ static void infile_set(const char *newin static off_t infile_total; /* total expected to read/write */ static off_t infile_current; /* current read/write */ +#ifdef SIGINFO static void check_siginfo(void); +#else +#define check_siginfo() /* nothing */ +#endif static off_t cat_fd(unsigned char *, size_t, off_t *, int fd); static void prepend_gzip(char *, int *, char ***); static void handle_dir(char *); @@ -1217,18 +1223,22 @@ unlink_input(const char *file, const str unlink(file); } +#ifdef SIGINFO static void got_siginfo(int signo) { print_info = 1; } +#endif static void setup_signals(void) { +#ifdef SIGINFO signal(SIGINFO, got_siginfo); +#endif } static void @@ -1713,7 +1723,7 @@ file_uncompress(char *file, char *outfil return -1; } -#ifndef SMALL +#ifndef check_siginfo static void check_siginfo(void) {