From: Tim Kientzle Date: Fri, 12 Jun 2009 05:14:33 +0000 (-0400) Subject: If signals can't be handled, stub out the setup functions. X-Git-Tag: v2.8.0~589 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dbe0cca64f69d583fbad812caaf5552b07fa5ce;p=thirdparty%2Flibarchive.git If signals can't be handled, stub out the setup functions. SVN-Revision: 1160 --- diff --git a/tar/siginfo.c b/tar/siginfo.c index a72a27f81..f5e3d88ac 100644 --- a/tar/siginfo.c +++ b/tar/siginfo.c @@ -52,7 +52,9 @@ struct siginfo_data { #ifdef SIGINFO struct sigaction siginfo_old; #endif +#ifdef SIGUSR1 struct sigaction sigusr1_old; +#endif }; #if defined(SIGINFO) || defined(SIGUSR1) @@ -68,7 +70,6 @@ siginfo_handler(int sig) /* Record that SIGINFO or SIGUSR1 has been received. */ siginfo_received = 1; } -#endif void siginfo_init(struct bsdtar *bsdtar) @@ -96,6 +97,14 @@ siginfo_init(struct bsdtar *bsdtar) lafe_errc(1, errno, "sigaction(SIGUSR1) failed"); #endif } +#else +void +siginfo_init(struct bsdtar *bsdtar) +{ + /* Set the strings to NULL so that free() is safe. */ + bsdtar->siginfo->path = bsdtar->siginfo->oper = NULL; +} +#endif void siginfo_setinfo(struct bsdtar *bsdtar, const char * oper, const char * path,