lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev NSL fork broken under AIX 4


From: Jens Schmalzing
Subject: lynx-dev NSL fork broken under AIX 4
Date: Tue, 1 Dec 1998 16:40:48 +0100

Dear all,

when building lynx version 2.8.1 under AIX 4 with the nsl fork feature
enabled, I run into a compile time error in the file HTTCP.c in
WWW/Library/Implementation/.  The problem persists in the current
developmental version 2.8.2dev.7.  It is apparently due to a
conflicting return types of the wait() function, and can be solved
using the patch below.

Hope this was the right place to send it, and you find it useful.
Anyway, keep up the good work.

Regards, Jens.



sys/m_wait.h header.
*** 2.8.2dev.7-orig/WWW/Library/Implementation/HTTCP.c  Wed Nov 18 20:23:55 1998
--- 2.8.2dev.7/WWW/Library/Implementation/HTTCP.c       Tue Dec  1 16:24:42 1998
***************
*** 449,455 ****
            **  control variables.
            */
            pid_t fpid, waitret;
!           int pfd[2], h_length, selret, readret, waitstat = 0, cycle = 0;
            fd_set readfds;
            struct timeval timeout;
            int dns_patience = 30; /* how many seconds will we wait for DNS? */
--- 449,462 ----
            **  control variables.
            */
            pid_t fpid, waitret;
!           int pfd[2], h_length, selret, readret, cycle = 0;
! #ifdef HAVE_TYPE_UNIONWAIT
!           union wait waitstat;
! #define WAITSTAT &(waitstat.w_status)
! #else
!           int waitstat = 0;
! #define WAITSTAT &waitstat
! #endif
            fd_set readfds;
            struct timeval timeout;
            int dns_patience = 30; /* how many seconds will we wait for DNS? */
***************
*** 582,592 ****
                    /*
                    **  Make sure child is cleaned up.  -BL
                    */
                    if (!child_exited)
!                       waitret = waitpid(fpid, &waitstat, WNOHANG);
                    if (!WIFEXITED(waitstat) && !WIFSIGNALED(waitstat)) {
                        kill(fpid, SIGTERM);
!                       waitret = waitpid(fpid, &waitstat, WNOHANG);
                    }
                    break;
                }
--- 589,602 ----
                    /*
                    **  Make sure child is cleaned up.  -BL
                    */
+ #define WIFEXITED(__x) (!((__x) & 0xff))
+ #define WIFSTOPPED(__x)  ((__x) & _W_STOPPED)
+ 
                    if (!child_exited)
!                       waitret = waitpid(fpid, WAITSTAT, WNOHANG);
                    if (!WIFEXITED(waitstat) && !WIFSIGNALED(waitstat)) {
                        kill(fpid, SIGTERM);
!                       waitret = waitpid(fpid, WAITSTAT, WNOHANG);
                    }
                    break;
                }
***************
*** 595,607 ****
                **  Clean up if child exited before & no data received.  -BL
                */
                if (child_exited) {
!                   waitret = waitpid(fpid, &waitstat, WNOHANG);
                    break;
                }
                /*
                **  If child exited, loop once more looking for data.  -BL
                */
!               if ((waitret = waitpid(fpid, &waitstat, WNOHANG)) > 0) {
                    /*
                    **  Data will be arriving right now, so make sure we
                    **  don't short-circuit out for too many loops, and
--- 605,617 ----
                **  Clean up if child exited before & no data received.  -BL
                */
                if (child_exited) {
!                   waitret = waitpid(fpid, WAITSTAT, WNOHANG);
                    break;
                }
                /*
                **  If child exited, loop once more looking for data.  -BL
                */
!               if ((waitret = waitpid(fpid, WAITSTAT, WNOHANG)) > 0) {
                    /*
                    **  Data will be arriving right now, so make sure we
                    **  don't short-circuit out for too many loops, and
***************
*** 627,633 ****
            close(pfd[0]);
            if (waitret <= 0) {
                kill(fpid, SIGTERM);
!               waitret = waitpid(fpid, &waitstat, WNOHANG);
            }
            if (waitret > 0) {
                if (WIFEXITED(waitstat)) {
--- 637,643 ----
            close(pfd[0]);
            if (waitret <= 0) {
                kill(fpid, SIGTERM);
!               waitret = waitpid(fpid, WAITSTAT, WNOHANG);
            }
            if (waitret > 0) {
                if (WIFEXITED(waitstat)) {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]