# HG changeset patch # User Sadrul Habib Chowdhury # Date 1190255929 0 # Node ID f34ffa69fdce54b8326596d6cc367c52be3dd1c3 # Parent 9d812753d26aebaebdb9c3c49b9d504ecf95ada4 Reset file descriptors to -1 instead of 0. This should fix some weird unexpected crashes in finch. diff -r 9d812753d26a -r f34ffa69fdce libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Wed Sep 19 21:40:02 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Thu Sep 20 02:38:49 2007 +0000 @@ -281,13 +281,9 @@ } } } else { - /* TODO: Using xfer->fd like this is probably a bad thing... */ + xfer->fd = -1; if (purple_proxy_connect(NULL, account, xfer_data->host, xfer_data->port, - yahoo_receivefile_connected, xfer) == NULL) - xfer->fd = -1; - else - xfer->fd = 0; - if (xfer->fd == -1) { + yahoo_receivefile_connected, xfer) == NULL) { purple_notify_error(gc, NULL, _("File Transfer Failed"), _("Unable to establish file descriptor.")); purple_xfer_cancel_remote(xfer); diff -r 9d812753d26a -r f34ffa69fdce libpurple/upnp.c --- a/libpurple/upnp.c Wed Sep 19 21:40:02 2007 +0000 +++ b/libpurple/upnp.c Thu Sep 20 02:38:49 2007 +0000 @@ -553,7 +553,7 @@ dd->inpa = 0; close(dd->fd); - dd->fd = 0; + dd->fd = -1; /* parse the response, and see if it was a success */ purple_upnp_parse_discover_response(buf, len, dd);