Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/flap_connection.c @ 21121:35b4f1dc4c8d
replace most calls to strerror with calls to g_strerror. strerror will return
a locale-specific string in the locale-specific encoding, which isn't
guaranteed to be UTF-8. g_strerror will always return a UTF-8 string.
I left gg and zephyr untouched, since gg doesn't include glib headers yet,
and zephyr does something weird with a #define for strerror. Someone more
familliar with those should take a look.
And the win32 guys should check and see if I screwed something up, since
they had strerror #defined to something else.
This should fix #2247 (and maybe some mystery crashes)
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 03 Nov 2007 17:52:28 +0000 |
parents | 5723dbc6212d |
children | 38cc722159ff |
comparison
equal
deleted
inserted
replaced
21120:0cc12e6909e2 | 21121:35b4f1dc4c8d |
---|---|
466 * | 466 * |
467 * @param reason The reason for the disconnection. | 467 * @param reason The reason for the disconnection. |
468 * @param error_message A brief error message that gives more detail | 468 * @param error_message A brief error message that gives more detail |
469 * regarding the reason for the disconnecting. This should | 469 * regarding the reason for the disconnecting. This should |
470 * be NULL for everything except OSCAR_DISCONNECT_LOST_CONNECTION, | 470 * be NULL for everything except OSCAR_DISCONNECT_LOST_CONNECTION, |
471 * in which case it should contain the value of strerror(errno), | 471 * in which case it should contain the value of g_strerror(errno), |
472 * and OSCAR_DISCONNECT_COULD_NOT_CONNECT, in which case it | 472 * and OSCAR_DISCONNECT_COULD_NOT_CONNECT, in which case it |
473 * should contain the error_message passed back from the call | 473 * should contain the error_message passed back from the call |
474 * to purple_proxy_connect(). | 474 * to purple_proxy_connect(). |
475 */ | 475 */ |
476 void | 476 void |
810 /* No worries */ | 810 /* No worries */ |
811 break; | 811 break; |
812 | 812 |
813 /* Error! */ | 813 /* Error! */ |
814 flap_connection_schedule_destroy(conn, | 814 flap_connection_schedule_destroy(conn, |
815 OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); | 815 OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno)); |
816 break; | 816 break; |
817 } | 817 } |
818 | 818 |
819 /* If we don't even have a complete FLAP header then do nothing */ | 819 /* If we don't even have a complete FLAP header then do nothing */ |
820 conn->header_received += read; | 820 conn->header_received += read; |
871 /* No worries */ | 871 /* No worries */ |
872 break; | 872 break; |
873 | 873 |
874 /* Error! */ | 874 /* Error! */ |
875 flap_connection_schedule_destroy(conn, | 875 flap_connection_schedule_destroy(conn, |
876 OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); | 876 OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno)); |
877 break; | 877 break; |
878 } | 878 } |
879 | 879 |
880 conn->buffer_incoming.data.offset += read; | 880 conn->buffer_incoming.data.offset += read; |
881 if (conn->buffer_incoming.data.offset < conn->buffer_incoming.data.len) | 881 if (conn->buffer_incoming.data.offset < conn->buffer_incoming.data.len) |
922 purple_input_remove(conn->watcher_outgoing); | 922 purple_input_remove(conn->watcher_outgoing); |
923 conn->watcher_outgoing = 0; | 923 conn->watcher_outgoing = 0; |
924 close(conn->fd); | 924 close(conn->fd); |
925 conn->fd = -1; | 925 conn->fd = -1; |
926 flap_connection_schedule_destroy(conn, | 926 flap_connection_schedule_destroy(conn, |
927 OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); | 927 OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno)); |
928 return; | 928 return; |
929 } | 929 } |
930 | 930 |
931 purple_circ_buffer_mark_read(conn->buffer_outgoing, ret); | 931 purple_circ_buffer_mark_read(conn->buffer_outgoing, ret); |
932 } | 932 } |