Changeset 2d04312 for zephyr.c


Ignore:
Timestamp:
Jun 22, 2011, 12:37:22 AM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
aa69c1e
Parents:
a6a9ddb
git-author:
David Benjamin <davidben@mit.edu> (05/24/11 02:09:29)
git-committer:
David Benjamin <davidben@mit.edu> (06/22/11 00:37:22)
Message:
Use g_io_add_watch in zephyr initialization

Which removes the final use of owl_io_dispatch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r72146c7 r2d04312  
    4848  struct sockaddr_in sin;
    4949  ZNotice_t req;
     50  GIOChannel *channel;
    5051
    5152  /*
     
    9192  }
    9293
    93   owl_select_add_io_dispatch(ZGetFD(), OWL_IO_READ|OWL_IO_EXCEPT, &owl_zephyr_finish_initialization, NULL, NULL);
    94 }
    95 
    96 void owl_zephyr_finish_initialization(const owl_io_dispatch *d, void *data) {
     94  channel = g_io_channel_unix_new(ZGetFD());
     95  g_io_add_watch(channel, G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP,
     96                 &owl_zephyr_finish_initialization, NULL);
     97  g_io_channel_unref(channel);
     98}
     99
     100gboolean owl_zephyr_finish_initialization(GIOChannel *source, GIOCondition condition, void *data) {
    97101  Code_t code;
    98102  char *perl;
    99103  GSource *event_source;
    100104
    101   owl_select_remove_io_dispatch(d);
    102 
    103105  ZClosePort();
    104106
    105107  if ((code = ZInitialize()) != ZERR_NONE) {
    106108    owl_function_error("Initializing Zephyr: %s", error_message(code));
    107     return;
     109    return FALSE;
    108110  }
    109111
    110112  if ((code = ZOpenPort(NULL)) != ZERR_NONE) {
    111113    owl_function_error("Initializing Zephyr: %s", error_message(code));
    112     return;
     114    return FALSE;
    113115  }
    114116
     
    143145  perl = owl_perlconfig_execute("BarnOwl::Zephyr::_zephyr_startup()");
    144146  g_free(perl);
     147  return FALSE;
    145148}
    146149
Note: See TracChangeset for help on using the changeset viewer.