Changeset 9a2eb14 in mainline for uspace/lib/c/generic/irc.c
- Timestamp:
- 2017-10-15T15:04:15Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1974f56a
- Parents:
- 75911d24
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/irc.c
r75911d24 r9a2eb14 35 35 #include <assert.h> 36 36 #include <errno.h> 37 #include <fibril_synch.h> 37 38 #include <ipc/irc.h> 38 39 #include <ipc/services.h> 39 40 #include <irc.h> 40 #include <ns.h> 41 #include <loc.h> 42 #include <stdlib.h> 41 43 #include <sysinfo.h> 42 44 … … 49 51 static int irc_init(void) 50 52 { 53 category_id_t irc_cat; 54 service_id_t *svcs; 55 size_t count; 56 int rc; 57 51 58 assert(irc_sess == NULL); 59 rc = loc_category_get_id("irc", &irc_cat, IPC_FLAG_BLOCKING); 60 if (rc != EOK) 61 return EIO; 52 62 53 irc_sess = service_connect_blocking(SERVICE_IRC, INTERFACE_IRC, 0); 63 while (true) { 64 rc = loc_category_get_svcs(irc_cat, &svcs, &count); 65 if (rc != EOK) 66 return EIO; 67 68 if (count > 0) 69 break; 70 71 free(svcs); 72 73 // XXX This is just a temporary hack 74 fibril_usleep(500 * 1000); 75 } 76 77 irc_sess = loc_service_connect(svcs[0], INTERFACE_IRC, 78 IPC_FLAG_BLOCKING); 79 free(svcs); 54 80 55 81 if (irc_sess == NULL)
Note:
See TracChangeset
for help on using the changeset viewer.