Changeset 7d969f3 for zephyr.c


Ignore:
Timestamp:
Mar 6, 2011, 2:14:52 PM (14 years ago)
Author:
Karl Ramm <kcr@1ts.org>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
41f0cf3
Parents:
c518676
git-author:
Karl Ramm <kcr@1ts.org> (02/12/11 00:03:19)
git-committer:
Karl Ramm <kcr@1ts.org> (03/06/11 14:14:52)
Message:
refactor owl_zephyr_zlog_in and report errors in owl_zephyr_zlog_{in,out}

Use the function ZParseExposureLevel thoughtfully provided by the library,
and see what happens when we actually report errors that occur here.

Reviewed-By: Nelson Elhage <nelhage@nelhage.com>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    rc518676 r7d969f3  
    10271027{
    10281028#ifdef HAVE_LIBZEPHYR
    1029   const char *exposure, *eset;
    1030   int ret;
     1029  char *exposure, *eset;
     1030  Code_t ret;
    10311031
    10321032  ZResetAuthentication();
    1033    
    1034   eset=EXPOSE_REALMVIS;
    1035   exposure=ZGetVariable(zstr("exposure"));
    1036   if (exposure==NULL) {
    1037     eset=EXPOSE_REALMVIS;
    1038   } else if (!strcasecmp(exposure,EXPOSE_NONE)) {
    1039     eset = EXPOSE_NONE;
    1040   } else if (!strcasecmp(exposure,EXPOSE_OPSTAFF)) {
    1041     eset = EXPOSE_OPSTAFF;
    1042   } else if (!strcasecmp(exposure,EXPOSE_REALMVIS)) {
    1043     eset = EXPOSE_REALMVIS;
    1044   } else if (!strcasecmp(exposure,EXPOSE_REALMANN)) {
    1045     eset = EXPOSE_REALMANN;
    1046   } else if (!strcasecmp(exposure,EXPOSE_NETVIS)) {
    1047     eset = EXPOSE_NETVIS;
    1048   } else if (!strcasecmp(exposure,EXPOSE_NETANN)) {
    1049     eset = EXPOSE_NETANN;
    1050   }
     1033
     1034  eset = EXPOSE_REALMVIS;
     1035  exposure = ZGetVariable(zstr("exposure"));
     1036  if (exposure)
     1037    exposure = ZParseExposureLevel(exposure);
     1038  if (exposure)
     1039    eset = exposure;
    10511040   
    1052   ret=ZSetLocation(zstr(eset));
    1053   if (ret != ZERR_NONE) {
    1054     /*
    1055       owl_function_makemsg("Error setting location: %s", error_message(ret));
    1056     */
    1057   }
     1041  ret = ZSetLocation(eset);
     1042  if (ret != ZERR_NONE)
     1043    owl_function_error("Error setting location: %s", error_message(ret));
    10581044#endif
    10591045}
     
    10621048{
    10631049#ifdef HAVE_LIBZEPHYR
    1064   int ret;
     1050  Code_t ret;
    10651051
    10661052  ZResetAuthentication();
    1067   ret=ZUnsetLocation();
    1068   if (ret != ZERR_NONE) {
    1069     /*
    1070       owl_function_makemsg("Error unsetting location: %s", error_message(ret));
    1071     */
    1072   }
     1053  ret = ZUnsetLocation();
     1054  if (ret != ZERR_NONE)
     1055    owl_function_error("Error unsetting location: %s", error_message(ret));
    10731056#endif
    10741057}
Note: See TracChangeset for help on using the changeset viewer.