Changeset 0743696


Ignore:
Timestamp:
Sep 14, 2010, 2:11:44 AM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
ba042db
Parents:
f544216
git-author:
David Benjamin <davidben@mit.edu> (08/21/10 23:23:08)
git-committer:
David Benjamin <davidben@mit.edu> (09/14/10 02:11:44)
Message:
Don't ignore the error code when doing a zwrite

Display a com_err-supplied error message. It's about time we fix the
false "Waiting for ack..." messages. Also, on an error in a zephyr with
multiple recipients, abort instead of continuing to send, to match the
zwrite binary.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    re488ec5 r0743696  
    345345{
    346346  owl_message *m;
     347  int ret;
    347348
    348349  if(strcmp(z->cmd, "zcrypt") == 0) {
     
    356357    owl_zwrite_set_message(z, msg);
    357358  }
    358   owl_zwrite_send_message(z);
     359  ret = owl_zwrite_send_message(z);
     360  if (ret != 0) {
     361    owl_function_makemsg("Error sending zephyr: %s", error_message(ret));
     362    return;
     363  }
    359364  owl_function_makemsg("Waiting for ack...");
    360365
  • zwrite.c

    r7bfc613 r0743696  
    254254int owl_zwrite_send_message(const owl_zwrite *z)
    255255{
    256   int i, j;
     256  int i, j, ret = 0;
    257257  char *to = NULL;
    258258
     
    267267        to = owl_strdup( owl_list_get_element(&(z->recips), i));
    268268      }
    269       send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
     269      ret = send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
     270      /* Abort on the first error, to match the zwrite binary. */
     271      if (ret != 0)
     272        break;
    270273      owl_free(to);
    271274      to = NULL;
     
    273276  } else {
    274277    to = owl_sprintf( "@%s", z->realm);
    275     send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
     278    ret = send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
    276279  }
    277280  owl_free(to);
    278   return(0);
     281  return ret;
    279282}
    280283
Note: See TracChangeset for help on using the changeset viewer.