diff options
author | joerg <joerg> | 2009-11-13 19:52:49 +0000 |
---|---|---|
committer | joerg <joerg> | 2009-11-13 19:52:49 +0000 |
commit | a26d5509c999d049b3f43c8cc027bc064b47e92b (patch) | |
tree | 1e8e1bcd9794afc3e0506152ff051d4ba36deec6 /net | |
parent | 56da03453d790e535aedfd213930a8e8ec0dd67b (diff) | |
download | pkgsrc-a26d5509c999d049b3f43c8cc027bc064b47e92b.tar.gz |
Only use SIGINFO if the platform supports it.
Diffstat (limited to 'net')
-rw-r--r-- | net/fetch/files/fetch.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/net/fetch/files/fetch.c b/net/fetch/files/fetch.c index 34bf7a1ffcb..41ecb00bd50 100644 --- a/net/fetch/files/fetch.c +++ b/net/fetch/files/fetch.c @@ -109,7 +109,9 @@ long w_secs; /* -w: retry delay */ int family = PF_UNSPEC; /* -[46]: address family to use */ volatile int sigalrm; /* SIGALRM received */ +#ifdef SIGINFO volatile int siginfo; /* SIGINFO received */ +#endif volatile int sigint; /* SIGINT received */ long ftp_timeout; /* default timeout for FTP transfers */ @@ -128,9 +130,11 @@ sig_handler(int sig) fetchRestartCalls = 0; sigalrm = 1; break; +#ifdef SIGINFO case SIGINFO: siginfo = 1; break; +#endif case SIGINT: fetchRestartCalls = 0; sigint = 1; @@ -643,20 +647,25 @@ fetch(char *URL, const char *path) /* start the counter */ stat_start(&xs, path, us.size, count); - sigalrm = siginfo = sigint = 0; + sigalrm = sigint = 0; /* suck in the data */ +#ifdef SIGINFO + siginfo = 0; signal(SIGINFO, sig_handler); +#endif while (!sigint) { if (us.size != -1 && us.size - count < B_size && us.size - count >= 0) size = us.size - count; else size = B_size; +#ifdef SIGINFO if (siginfo) { stat_display(&xs, 1); siginfo = 0; } +#endif if ((ssize = fetchIO_read(f, buf, B_size)) == 0) break; if (ssize == -1 && errno == EINTR) @@ -678,7 +687,9 @@ fetch(char *URL, const char *path) } if (!sigalrm) sigalrm = 0; +#ifdef SIGINFO signal(SIGINFO, SIG_DFL); +#endif stat_end(&xs); |