info-cvs
[Top][All Lists]
Advanced

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

Re: Building CVS on Windows is broken...again


From: Derek Robert Price
Subject: Re: Building CVS on Windows is broken...again
Date: Sun, 15 Feb 2004 17:59:42 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Larry Jones wrote:

>Derek Robert Price writes:
>
>>Now, are you _sure_ there is no equivalent to fcntl() under Windows?  I
>>notice that both windows-nt/run.c and windows-nt/rcmd.c are including
>><fcntl.h>.  Are you certain there isn't just some library we're
>>neglecting to include or some other function name (like "_fcntl()") we
>>should be using?  I've seen similar problems with other POSIX functions
>>under Windows.
>
>
>set_nonblock_fd() is a highly specialized function that is only used by
>the server code and *should* only be used by the server code.  I say put
>it back in server.c.


It allowed me to check for unsent data in the buffer where the getc()
used to block with the wrong combination of client and server.  Do you
not think this is worth it or do you have an alternative?

    if (buf->input)
    {
        /* This used to check for getc (bc->fp) != EOF too, but there was an
         * odd race condition that would sometimes cause a dead server child
         * process to cause a SIGPIPE to be delivered to the server parent
         * before the SIGCHILD while the client was in a read state and the
         * buffer was empty.  The previous server assumption was that a
         * SIGPIPE meant that the _network_ pipe, to the client, broke,
so it
         * was okay to assume that the blocking getc() would return a
char or
         * EOF.  When the SIGPIPE is received due to a problem writing to a
         * server child, however, and the client pipe still exists, and the
         * client is reading, this call to getc() would block indefinitely
         * waiting for info from the client while the client blocked waiting
         * for a read from the server...  in other words, deadlock occurred.
         *
         * Anyhow, that old getc() has been replaced with the mess below.
         */
        char junk;
        if (!buf_empty_p (buf)
            || (!feof (bc->fp)
                && set_nonblock_fd (fileno (bc->fp)) == 0
                && fread (&junk, 1, 1, bc->fp) != 0))
        {
# ifdef SERVER_SUPPORT
            if (server_active)
                /* FIXME: This should probably be sysloged since it doesn't
                 * have anywhere else to go at this point.
                 */
                error (0, 0, "dying gasps from client unexpected");
            else
#endif
                error (0, 0, "dying gasps from %s unexpected",
                       current_parsed_root->hostname);
 

yada, yada, yada...

Derek

- --
                *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org

iD8DBQFAL/ndLD1OTBfyMaQRAkMrAJ9LgGw26naW7e9VDuBoNvS9kQGCtgCdHcZp
DkZ+cVCHilJtEjoDQ2ndrpg=
=YcZC
-----END PGP SIGNATURE-----






reply via email to

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