Lines Matching refs:rc
108 int rc; in main() local
119 if ((rc = dm_init_service(&varstr)) != 0) { in main()
122 rc, errno); in main()
124 } else if ((rc = dm_create_session(DM_NO_SESSION, szSessionInfo, &sid)) in main()
128 rc, errno); in main()
148 rc = dm_get_events(INVALID_ADDR, 0, 0, sizeof(buf), buf, &rlen); in main()
149 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
163 rc = pthread_create(&tid, NULL, Thread, in main()
165 if (rc == -1) { in main()
186 rc = pthread_create(&tid, NULL, Thread, in main()
188 if (rc == -1) { in main()
209 rc = pthread_create(&tid, NULL, Thread, in main()
211 if (rc == -1) { in main()
230 rc = pthread_create(&tid, NULL, Thread, in main()
232 if (rc == -1) { in main()
253 rc = pthread_create(&tid, NULL, Thread, in main()
255 if (rc == -1) { in main()
278 rc = pthread_create(&tid, NULL, Thread, in main()
280 if (rc == -1) { in main()
303 rc = dm_send_msg(sid, DM_MSGTYPE_ASYNC, MSG_DATALEN, buf); in main()
304 if (rc != -1) { in main()
305 rc = pthread_create(&tid, NULL, Thread, in main()
308 if (rc == -1) { in main()
331 rc = dm_send_msg(sid, DM_MSGTYPE_ASYNC, MSG_DATALEN, buf); in main()
332 if (rc != -1) { in main()
333 rc = pthread_create(&tid, NULL, Thread, in main()
336 if (rc == -1) { in main()
359 for (i = 0, rc = 0; i < MAX_EVENT + 1 && rc == 0; i++) { in main()
361 rc = dm_send_msg(sid, DM_MSGTYPE_ASYNC, j + 1, buf); in main()
363 if (rc != -1) { in main()
364 rc = pthread_create(&tid, NULL, Thread, in main()
367 if (rc == -1) { in main()
392 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
393 if (rc == -1) { in main()
402 rc = dm_respond_event(INVALID_ADDR, token, in main()
405 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
408 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
410 if (rc == -1) { in main()
428 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
429 if (rc == -1) { in main()
438 rc = dm_respond_event(DM_NO_SESSION, token, in main()
441 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
444 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
446 if (rc == -1) { in main()
466 rc = dm_respond_event(sid, INVALID_ADDR, DM_RESP_CONTINUE, 0, in main()
468 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
485 rc = dm_respond_event(sid, DM_NO_TOKEN, DM_RESP_CONTINUE, 0, in main()
487 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
505 rc = dm_respond_event(sid, DM_INVALID_TOKEN, DM_RESP_CONTINUE, in main()
507 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
522 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
523 if (rc == -1) { in main()
532 rc = dm_respond_event(sid, token, INVALID_ADDR, 0, in main()
534 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
537 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
539 if (rc == -1) { in main()
560 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
561 if (rc == -1) { in main()
570 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
572 DMVAR_ENDFAILEXP(szFuncName, -1, rc, E2BIG); in main()
575 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
577 if (rc == -1) { in main()
595 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
596 if (rc != -1) { in main()
597 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
600 if (rc == -1) { in main()
609 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
611 DMVAR_ENDFAILEXP(szFuncName, -1, rc, ESRCH); in main()
626 rc = pthread_create(&tid, NULL, Thread, in main()
628 if (rc == -1) { in main()
649 rc = pthread_create(&tid, NULL, Thread, in main()
651 if (rc == -1) { in main()
658 rc = dm_send_msg(sid, DM_MSGTYPE_SYNC, MSG_DATALEN, in main()
661 if (rc == 0) { in main()
664 szFuncName, rcRespond, rc); in main()
669 szFuncName, rcRespond, rc, in main()
693 rc = pthread_create(&tid, NULL, Thread, in main()
695 if (rc == -1) { in main()
716 rc = pthread_create(&tid, NULL, Thread, in main()
718 if (rc == -1) { in main()
739 rc = pthread_create(&tid, NULL, Thread, in main()
741 if (rc == -1) { in main()
748 rc = dm_send_msg(sid, DM_MSGTYPE_SYNC, MSG_DATALEN, in main()
751 if (rc == -1) { in main()
756 rcRespond, rc); in main()
762 rcRespond, rc, in main()
769 szFuncName, rcRespond, rc, in main()
793 rc = pthread_create(&tid, NULL, Thread, in main()
795 if (rc == -1) { in main()
820 if ((rc = in main()
825 if ((rc = in main()
830 if (rc == -1) { in main()
839 rc = dm_move_event(INVALID_ADDR, token, targsid, in main()
841 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
844 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
846 rc |= dm_destroy_session(targsid); in main()
847 if (rc == -1) { in main()
866 if ((rc = in main()
871 if ((rc = in main()
876 if (rc == -1) { in main()
885 rc = dm_move_event(DM_NO_SESSION, token, targsid, in main()
887 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
890 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
892 rc |= dm_destroy_session(targsid); in main()
893 if (rc == -1) { in main()
912 if ((rc = in main()
917 if ((rc = in main()
922 if (rc == -1) { in main()
931 rc = dm_move_event(sid, INVALID_ADDR, targsid, &rtoken); in main()
932 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
935 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
937 rc |= dm_destroy_session(targsid); in main()
938 if (rc == -1) { in main()
957 if ((rc = in main()
962 if ((rc = in main()
967 if (rc == -1) { in main()
976 rc = dm_move_event(sid, token, INVALID_ADDR, &rtoken); in main()
977 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
980 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
982 rc |= dm_destroy_session(targsid); in main()
983 if (rc == -1) { in main()
1002 if ((rc = in main()
1007 if ((rc = in main()
1012 if (rc == -1) { in main()
1022 rc = dm_move_event(sid, token, DM_NO_SESSION, &rtoken); in main()
1023 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
1026 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
1028 rc |= dm_destroy_session(targsid); in main()
1029 if (rc == -1) { in main()
1051 if ((rc = in main()
1056 if ((rc = in main()
1061 if (rc == -1) { in main()
1070 rc = dm_move_event(sid, token, targsid, in main()
1072 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EFAULT); in main()
1075 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
1077 rc |= dm_destroy_session(targsid); in main()
1078 if (rc == -1) { in main()
1100 if ((rc = in main()
1105 if ((rc = in main()
1110 if (rc == -1) { in main()
1119 rc = dm_move_event(targsid, token, sid, &rtoken); in main()
1120 DMVAR_ENDFAILEXP(szFuncName, -1, rc, ENOENT); in main()
1123 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
1125 rc |= dm_destroy_session(targsid); in main()
1126 if (rc == -1) { in main()
1146 if ((rc = in main()
1151 if ((rc = in main()
1156 if (rc == -1) { in main()
1165 rc = dm_move_event(sid, token, sid, &rtoken); in main()
1166 if (rc == 0) { in main()
1169 rc = dm_find_eventmsg(sid, rtoken, in main()
1172 if (rc == 0 && rlen > 0) { in main()
1186 szFuncName, rc, errno); in main()
1191 rc = dm_respond_event(sid, rtoken, DM_RESP_CONTINUE, 0, in main()
1193 rc |= dm_destroy_session(targsid); in main()
1194 if (rc == -1) { in main()
1217 if ((rc = in main()
1222 if ((rc = in main()
1227 if (rc == -1) { in main()
1236 rc = dm_move_event(sid, token, targsid, &rtoken); in main()
1237 if (rc == 0) { in main()
1240 rc = dm_find_eventmsg(sid, token, in main()
1243 if (rc == -1 && errno == EINVAL) { in main()
1244 rc = dm_find_eventmsg(targsid, rtoken, in main()
1247 if (rc == 0 && rlen > 0) { in main()
1268 szFuncName, rc, errno); in main()
1273 rc = dm_respond_event(targsid, rtoken, DM_RESP_CONTINUE, in main()
1275 rc |= dm_destroy_session(targsid); in main()
1276 if (rc == -1) { in main()
1297 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
1298 if (rc == -1) { in main()
1307 rc = dm_pending(INVALID_ADDR, token, &delay); in main()
1308 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
1311 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
1313 if (rc == -1) { in main()
1332 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
1333 if (rc == -1) { in main()
1342 rc = dm_pending(DM_NO_SESSION, token, &delay); in main()
1343 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
1346 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
1348 if (rc == -1) { in main()
1367 rc = dm_pending(sid, INVALID_ADDR, &delay); in main()
1368 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
1384 rc = dm_pending(sid, DM_NO_TOKEN, &delay); in main()
1385 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
1402 rc = dm_pending(sid, DM_INVALID_TOKEN, &delay); in main()
1403 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in main()
1418 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
1419 if (rc == -1) { in main()
1428 rc = dm_pending(sid, token, in main()
1430 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EFAULT); in main()
1433 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
1435 if (rc == -1) { in main()
1454 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
1455 if (rc != -1) { in main()
1456 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
1459 if (rc == -1) { in main()
1468 rc = dm_pending(sid, token, &delay); in main()
1469 DMVAR_ENDFAILEXP(szFuncName, -1, rc, ESRCH); in main()
1486 rc = dm_create_userevent(sid, MSG_DATALEN, buf, &token); in main()
1487 if (rc == -1) { in main()
1495 rc = dm_pending(sid, token, &delay); in main()
1496 DMVAR_ENDPASSEXP(szFuncName, 0, rc); in main()
1499 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in main()
1501 if (rc == -1) { in main()
1509 rc = dm_destroy_session(sid); in main()
1510 if (rc == -1) { in main()
1513 rc, errno); in main()
1523 int rc; in Thread() local
1535 rc = dm_get_events(sid, MAX_EVENT, 0, 0, dmMsgBuf, &rlen); in Thread()
1536 DMVAR_ENDFAILEXP(szFuncName, -1, rc, E2BIG); in Thread()
1539 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1541 if (rc == 0) { in Thread()
1543 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in Thread()
1546 if (rc == -1) { in Thread()
1556 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1558 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EFAULT); in Thread()
1561 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1563 if (rc == 0) { in Thread()
1565 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in Thread()
1568 if (rc == -1) { in Thread()
1578 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1580 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EFAULT); in Thread()
1583 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1585 if (rc == 0) { in Thread()
1587 rc = dm_respond_event(sid, token, DM_RESP_CONTINUE, 0, in Thread()
1590 if (rc == -1) { in Thread()
1601 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1603 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EAGAIN); in Thread()
1620 rc = dm_get_events(sid, MAX_EVENT, eventsFlags, in Thread()
1622 } while ((eventsFlags & DM_EV_WAIT) && (rc == -1) in Thread()
1624 if (rc == 0) { in Thread()
1662 szFuncName, rc, errno); in Thread()
1667 rc = dm_respond_event(sid, in Thread()
1671 if (rc == -1) { in Thread()
1685 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1687 if (rc == 0) { in Thread()
1692 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1694 if (rc == 0) { in Thread()
1736 szFuncName, rc, errno); in Thread()
1743 szFuncName, rc, errno); in Thread()
1748 rc = dm_respond_event(sid, in Thread()
1752 if (rc == -1) { in Thread()
1763 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1765 if (rc == 0 && ((dmMsg = GetSyncEventMsg(dmMsgBuf)) != NULL)) { in Thread()
1766 rc = dm_respond_event(sid, dmMsg->ev_token, in Thread()
1768 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in Thread()
1771 rc = dm_respond_event(sid, dmMsg->ev_token, in Thread()
1773 if (rc == -1) { in Thread()
1781 rc, errno); in Thread()
1790 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1792 if (rc == 0 && ((dmMsg = GetSyncEventMsg(dmMsgBuf)) != NULL)) { in Thread()
1800 rc, errno); in Thread()
1809 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1811 if (rc == 0 && ((dmMsg = GetSyncEventMsg(dmMsgBuf)) != NULL)) { in Thread()
1812 rc = dm_respond_event(sid, dmMsg->ev_token, in Thread()
1815 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in Thread()
1818 rc = dm_respond_event(sid, dmMsg->ev_token, in Thread()
1820 if (rc == -1) { in Thread()
1828 rc, errno); in Thread()
1837 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1839 if (rc == 0 && ((dmMsg = GetSyncEventMsg(dmMsgBuf)) != NULL)) { in Thread()
1840 rc = dm_respond_event(sid, dmMsg->ev_token, in Thread()
1842 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in Thread()
1845 rc = dm_respond_event(sid, dmMsg->ev_token, in Thread()
1847 if (rc == -1) { in Thread()
1855 rc, errno); in Thread()
1864 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1866 if (rc == 0 && ((dmMsg = GetSyncEventMsg(dmMsgBuf)) != NULL)) { in Thread()
1875 rc, errno); in Thread()
1882 rc = dm_get_events(sid, MAX_EVENT, 0, sizeof(dmMsgBuf), in Thread()
1884 if (rc == 0 && ((dmMsg = GetSyncEventMsg(dmMsgBuf)) != NULL)) { in Thread()
1885 rc = dm_respond_event(sid, dmMsg->ev_token, in Thread()
1887 DMVAR_ENDFAILEXP(szFuncName, -1, rc, EINVAL); in Thread()
1890 rc = dm_respond_event(sid, dmMsg->ev_token, in Thread()
1892 if (rc == -1) { in Thread()
1900 rc, errno); in Thread()