/* *Handlecommonunexpectedportevents
*/ void tipc_handle_port_errors(const uevent_t* ev) { if ((ev->event & IPC_HANDLE_POLL_ERROR) ||
(ev->event & IPC_HANDLE_POLL_HUP) ||
(ev->event & IPC_HANDLE_POLL_MSG) ||
(ev->event & IPC_HANDLE_POLL_SEND_UNBLOCKED)) { /* should never happen with port handles */
TLOGE("error event (0x%x) for port (%d)\n", ev->event, ev->handle);
abort();
}
}
/* *Handlecommonunexpectedchannelevents
*/ void tipc_handle_chan_errors(const uevent_t* ev) { if ((ev->event & IPC_HANDLE_POLL_ERROR) ||
(ev->event & IPC_HANDLE_POLL_READY)) { /* close it as it is in an error state */
TLOGE("error event (0x%x) for chan (%d)\n", ev->event, ev->handle);
abort();
}
}
if (ev->event == IPC_HANDLE_POLL_NONE) { /* not really an event, do nothing */
TLOGI("got an empty event\n"); return;
}
/* check if we have handler */ struct tipc_event_handler* handler = ev->cookie; if (handler && handler->proc) { /* invoke it */
handler->proc(ev, handler->priv); return;
}
/* no handler? close it */
TLOGE("no handler for event (0x%x) with handle %d\n", ev->event,
ev->handle);
close(ev->handle);
return;
}
/* *Mainapplicationeventloop
*/ int main(void) { int rc;
uevent_t event;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.