Mercurial > pidgin.yaz
comparison libpurple/protocols/zephyr/zephyr.c @ 22131:d5e8ee52ddcc
Use g_strerror() instead of strerror() in a few places.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 16 Jan 2008 19:12:46 +0000 |
parents | d60aa8fdad55 |
children | 79b30c9e5937 |
comparison
equal
deleted
inserted
replaced
22129:dd51079b3d8c | 22131:d5e8ee52ddcc |
---|---|
163 /* ((tzcfodder . subscribe) ("class" "instance" "recipient")) */ | 163 /* ((tzcfodder . subscribe) ("class" "instance" "recipient")) */ |
164 gchar *zsubstr = g_strdup_printf("((tzcfodder . subscribe) (\"%s\" \"%s\" \"%s\"))\n",class,instance,recipient); | 164 gchar *zsubstr = g_strdup_printf("((tzcfodder . subscribe) (\"%s\" \"%s\" \"%s\"))\n",class,instance,recipient); |
165 size_t len = strlen(zsubstr); | 165 size_t len = strlen(zsubstr); |
166 result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zsubstr,len); | 166 result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zsubstr,len); |
167 if (result != len) { | 167 if (result != len) { |
168 purple_debug_error("zephyr", "Unable to write a message: %s\n", strerror(errno)); | 168 purple_debug_error("zephyr", "Unable to write a message: %s\n", g_strerror(errno)); |
169 } else { | 169 } else { |
170 ret_val = ZERR_NONE; | 170 ret_val = ZERR_NONE; |
171 } | 171 } |
172 g_free(zsubstr); | 172 g_free(zsubstr); |
173 } | 173 } |
1378 if (use_tzc(zephyr)) { | 1378 if (use_tzc(zephyr)) { |
1379 gchar *zlocstr = g_strdup_printf("((tzcfodder . zlocate) \"%s\")\n",chk); | 1379 gchar *zlocstr = g_strdup_printf("((tzcfodder . zlocate) \"%s\")\n",chk); |
1380 size_t len = strlen(zlocstr); | 1380 size_t len = strlen(zlocstr); |
1381 size_t result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zlocstr,len); | 1381 size_t result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zlocstr,len); |
1382 if (result != len) { | 1382 if (result != len) { |
1383 purple_debug_error("zephyr", "Unable to write a message: %s\n", strerror(errno)); | 1383 purple_debug_error("zephyr", "Unable to write a message: %s\n", g_strerror(errno)); |
1384 } | 1384 } |
1385 g_free(zlocstr); | 1385 g_free(zlocstr); |
1386 } | 1386 } |
1387 } | 1387 } |
1388 } | 1388 } |
2291 char* zlocstr = g_strdup_printf("((tzcfodder . zlocate) \"%s\")\n",normalized_who); | 2291 char* zlocstr = g_strdup_printf("((tzcfodder . zlocate) \"%s\")\n",normalized_who); |
2292 zephyr->pending_zloc_names = g_list_append(zephyr->pending_zloc_names, g_strdup(normalized_who)); | 2292 zephyr->pending_zloc_names = g_list_append(zephyr->pending_zloc_names, g_strdup(normalized_who)); |
2293 len = strlen(zlocstr); | 2293 len = strlen(zlocstr); |
2294 result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zlocstr,len); | 2294 result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zlocstr,len); |
2295 if (result != len) { | 2295 if (result != len) { |
2296 purple_debug_error("zephyr", "Unable to write a message: %s\n", strerror(errno)); | 2296 purple_debug_error("zephyr", "Unable to write a message: %s\n", g_strerror(errno)); |
2297 } | 2297 } |
2298 g_free(zlocstr); | 2298 g_free(zlocstr); |
2299 } | 2299 } |
2300 } | 2300 } |
2301 | 2301 |
2320 else { | 2320 else { |
2321 char *zexpstr = g_strdup_printf("((tzcfodder . set-location) (hostname . \"%s\") (exposure . \"%s\"))\n",zephyr->ourhost,zephyr->exposure); | 2321 char *zexpstr = g_strdup_printf("((tzcfodder . set-location) (hostname . \"%s\") (exposure . \"%s\"))\n",zephyr->ourhost,zephyr->exposure); |
2322 len = strlen(zexpstr); | 2322 len = strlen(zexpstr); |
2323 result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zexpstr,len); | 2323 result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zexpstr,len); |
2324 if (result != len) { | 2324 if (result != len) { |
2325 purple_debug_error("zephyr", "Unable to write message: %s\n", strerror(errno)); | 2325 purple_debug_error("zephyr", "Unable to write message: %s\n", g_strerror(errno)); |
2326 } | 2326 } |
2327 g_free(zexpstr); | 2327 g_free(zexpstr); |
2328 } | 2328 } |
2329 } | 2329 } |
2330 else if (primitive == PURPLE_STATUS_INVISIBLE) { | 2330 else if (primitive == PURPLE_STATUS_INVISIBLE) { |
2334 } else { | 2334 } else { |
2335 char *zexpstr = g_strdup_printf("((tzcfodder . set-location) (hostname . \"%s\") (exposure . \"%s\"))\n",zephyr->ourhost,EXPOSE_OPSTAFF); | 2335 char *zexpstr = g_strdup_printf("((tzcfodder . set-location) (hostname . \"%s\") (exposure . \"%s\"))\n",zephyr->ourhost,EXPOSE_OPSTAFF); |
2336 len = strlen(zexpstr); | 2336 len = strlen(zexpstr); |
2337 result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zexpstr,len); | 2337 result = write(zephyr->totzc[ZEPHYR_FD_WRITE],zexpstr,len); |
2338 if (result != len) { | 2338 if (result != len) { |
2339 purple_debug_error("zephyr", "Unable to write message: %s\n", strerror(errno)); | 2339 purple_debug_error("zephyr", "Unable to write message: %s\n", g_strerror(errno)); |
2340 } | 2340 } |
2341 g_free(zexpstr); | 2341 g_free(zexpstr); |
2342 } | 2342 } |
2343 } | 2343 } |
2344 } | 2344 } |