pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/fetch/files Only use SIGINFO if the platform suppo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1ca207095706
branches:  trunk
changeset: 567308:1ca207095706
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Nov 13 19:52:49 2009 +0000

description:
Only use SIGINFO if the platform supports it.

diffstat:

 net/fetch/files/fetch.c |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (62 lines):

diff -r f1d2d4044ab0 -r 1ca207095706 net/fetch/files/fetch.c
--- a/net/fetch/files/fetch.c   Fri Nov 13 19:40:55 2009 +0000
+++ b/net/fetch/files/fetch.c   Fri Nov 13 19:52:49 2009 +0000
@@ -109,7 +109,9 @@
 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 @@
                fetchRestartCalls = 0;
                sigalrm = 1;
                break;
+#ifdef SIGINFO
        case SIGINFO:
                siginfo = 1;
                break;
+#endif
        case SIGINT:
                fetchRestartCalls = 0;
                sigint = 1;
@@ -643,20 +647,25 @@
        /* 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 @@
        }
        if (!sigalrm)
                sigalrm = 0;
+#ifdef SIGINFO
        signal(SIGINFO, SIG_DFL);
+#endif
 
        stat_end(&xs);
 



Home | Main Index | Thread Index | Old Index