im.pidgin.pidgin: 84f67d7b25d842d187bc57e4427eb2fa781cdcf2

markdoliner at pidgin.im markdoliner at pidgin.im
Mon Jan 14 01:36:04 EST 2008


-----------------------------------------------------------------
Revision: 84f67d7b25d842d187bc57e4427eb2fa781cdcf2
Ancestor: 62329672fc026cbd20bc696555b1d85746d45559
Author: markdoliner at pidgin.im
Date: 2008-01-14T06:32:16
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/oscar/oscar.c

ChangeLog: 

More of ticket #1344 from o_sukhodolsky, which rlaager has been
committing pieces of.  This silences an error about ignoring the
return value from the 'write' system call.  References #1344.
References #4643.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	4bfe7cb341ee755546da5a936d3ea347e14ce86c
+++ libpurple/protocols/oscar/oscar.c	0c9a828788e6ae87cbbd342713d1838c5e03744c
@@ -1517,6 +1517,7 @@ straight_to_hell(gpointer data, gint sou
 {
 	struct pieceofcrap *pos = data;
 	gchar *buf;
+	ssize_t result;
 
 	if (!PURPLE_CONNECTION_IS_VALID(pos->gc))
 	{
@@ -1528,8 +1529,8 @@ straight_to_hell(gpointer data, gint sou
 	pos->fd = source;
 
 	if (source < 0) {
-		buf = g_strdup_printf(_("You may be disconnected shortly.  You may want to use TOC until "
-			"this is fixed.  Check %s for updates."), PURPLE_WEBSITE);
+		buf = g_strdup_printf(_("You may be disconnected shortly.  "
+				"Check %s for updates."), PURPLE_WEBSITE);
 		purple_notify_warning(pos->gc, NULL,
 							_("Unable to get a valid AIM login hash."),
 							buf);
@@ -1541,7 +1542,18 @@ straight_to_hell(gpointer data, gint sou
 
 	buf = g_strdup_printf("GET " AIMHASHDATA "?offset=%ld&len=%ld&modname=%s HTTP/1.0\n\n",
 			pos->offset, pos->len, pos->modname ? pos->modname : "");
-	write(pos->fd, buf, strlen(buf));
+	result = send(pos->fd, buf, strlen(buf), 0);
+	if (result != strlen(buf)) {
+		if (result < 0)
+			purple_debug_error("oscar", "Error writing %" G_GSIZE_FORMAT
+					" bytes to fetch AIM hash data: %s\n",
+					strlen(buf), strerror(errno));
+		else
+			purple_debug_error("oscar", "Tried to write %"
+					G_GSIZE_FORMAT " bytes to fetch AIM hash data but "
+					"instead wrote %" G_GSIZE_FORMAT " bytes\n",
+					strlen(buf), result);
+	}
 	g_free(buf);
 	g_free(pos->modname);
 	pos->inpa = purple_input_add(pos->fd, PURPLE_INPUT_READ, damn_you, pos);


More information about the Commits mailing list