Changeset c73a22d
- Timestamp:
- Mar 6, 2011, 2:14:39 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 00842c3
- Parents:
- 488913a
- git-author:
- Karl Ramm <kcr@1ts.org> (02/11/11 23:57:39)
- git-committer:
- Karl Ramm <kcr@1ts.org> (03/06/11 14:14:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
r488913a rc73a22d 211 211 { 212 212 int ret = 0; 213 Code_t code; 214 213 215 if (owl_global_is_havezephyr(&g)) { 214 216 int i; 215 217 /* sub without defaults */ 216 if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) { 217 owl_function_error("Error subscribing to zephyr notifications."); 218 code = ZSubscribeToSansDefaults(subs, count, 0); 219 if (code != ZERR_NONE) { 220 owl_function_error("Error subscribing to zephyr notifications: %s", 221 error_message(code)); 218 222 ret=-2; 219 223 } … … 351 355 { 352 356 #ifdef HAVE_LIBZEPHYR 357 Code_t ret; 358 353 359 if (owl_global_is_havezephyr(&g)) { 354 360 ZSubscription_t subs[10]; 355 356 if (ZSubscribeTo(subs,0,0) != ZERR_NONE) { 357 owl_function_error("Error subscribing to default zephyr notifications."); 361 362 ret = ZSubscribeTo(subs, 0, 0); 363 if (ret != ZERR_NONE) { 364 owl_function_error("Error subscribing to default zephyr notifications: %s.", 365 error_message(ret)); 358 366 return(-1); 359 367 } … … 435 443 #ifdef HAVE_LIBZEPHYR 436 444 ZSubscription_t subs[5]; 445 Code_t ret; 437 446 438 447 subs[0].zsub_class=zstr(class); … … 441 450 442 451 ZResetAuthentication(); 443 if (ZSubscribeTo(subs,1,0) != ZERR_NONE) { 444 owl_function_error("Error subbing to <%s,%s,%s>", class, inst, recip); 452 ret = ZSubscribeTo(subs, 1, 0); 453 if (ret != ZERR_NONE) { 454 owl_function_error("Error subbing to <%s,%s,%s>: %s", 455 class, inst, recip, 456 error_message(ret)); 445 457 return(-2); 446 458 } … … 456 468 #ifdef HAVE_LIBZEPHYR 457 469 ZSubscription_t subs[5]; 470 Code_t ret; 458 471 459 472 subs[0].zsub_class=zstr(class); … … 462 475 463 476 ZResetAuthentication(); 464 if (ZUnsubscribeTo(subs,1,0) != ZERR_NONE) { 465 owl_function_error("Error unsubbing from <%s,%s,%s>", class, inst, recip); 477 ret = ZUnsubscribeTo(subs, 1, 0); 478 if (ret != ZERR_NONE) { 479 owl_function_error("Error unsubbing from <%s,%s,%s>: %s", 480 class, inst, recip, 481 error_message(ret)); 466 482 return(-2); 467 483 } … … 668 684 { 669 685 #ifdef HAVE_LIBZEPHYR 670 int ret;686 Code_t ret; 671 687 ZNotice_t notice; 672 688 … … 703 719 g_free(notice.z_message); 704 720 ZFreeNotice(¬ice); 705 if (ret !=ZERR_NONE) {706 owl_function_error("Error sending zephyr ");721 if (ret != ZERR_NONE) { 722 owl_function_error("Error sending zephyr: %s", error_message(ret)); 707 723 return(ret); 708 724 } … … 1130 1146 { 1131 1147 #ifdef HAVE_LIBZEPHYR 1132 int ret, num, i, one; 1148 Code_t ret; 1149 int num, i, one; 1133 1150 ZSubscription_t sub; 1134 1151 GString *buf; 1135 1152 1136 ret=ZRetrieveSubscriptions(0, &num); 1137 if (ret==ZERR_TOOMANYSUBS) { 1138 return(g_strdup("Zephyr: too many subscriptions\n")); 1139 } else if (ret || (num <= 0)) { 1140 return(g_strdup("Zephyr: error retrieving subscriptions\n")); 1141 } 1153 ret = ZRetrieveSubscriptions(0, &num); 1154 if (ret != ZERR_NONE) 1155 return g_strdup_printf("Zephyr: Requesting subscriptions: %s\n", error_message(ret)); 1156 if (num == 0) 1157 return g_strdup("Zephyr: No subscriptions retrieved\n"); 1142 1158 1143 1159 buf = g_string_new(""); … … 1147 1163 ZFlushSubscriptions(); 1148 1164 g_string_free(buf, true); 1149 return g_strdup ("Error while getting subscriptions\n");1165 return g_strdup_printf("Zephyr: Getting subscriptions: %s\n", error_message(ret)); 1150 1166 } else { 1151 1167 /* g_string_append_printf would be backwards. */
Note: See TracChangeset
for help on using the changeset viewer.