diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-02-08 11:14:03 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-02-08 11:14:03 +0000 |
commit | ba1878c8122da61f2bda2a4cc0dc9ca7c88556f3 (patch) | |
tree | 6822476b021e6a2fd98dede4c51b01100404d133 /pjlib/src/pjlib-test | |
parent | c00a805879c4ec9724bc798caf8b402e397b13c4 (diff) |
Fixed build errors when PJ_OS_HAS_CHECK_STACK or PJ_HAS_TCP is disabled
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@153 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pjlib-test')
-rw-r--r-- | pjlib/src/pjlib-test/util.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pjlib/src/pjlib-test/util.c b/pjlib/src/pjlib-test/util.c index d5cded20..19b769cb 100644 --- a/pjlib/src/pjlib-test/util.c +++ b/pjlib/src/pjlib-test/util.c @@ -50,11 +50,13 @@ pj_status_t app_socket(int family, int type, int proto, int port, if (rc != PJ_SUCCESS) return rc; +#if PJ_HAS_TCP if (type == PJ_SOCK_STREAM) { rc = pj_sock_listen(sock, 5); if (rc != PJ_SUCCESS) return rc; } +#endif *ptr_sock = sock; return PJ_SUCCESS; @@ -94,11 +96,13 @@ pj_status_t app_socketpair(int family, int type, int protocol, goto on_error; /* For TCP, listen the socket. */ +#if PJ_HAS_TCP if (type == PJ_SOCK_STREAM) { rc = pj_sock_listen(sock[SERVER], PJ_SOMAXCONN); if (rc != PJ_SUCCESS) goto on_error; } +#endif /* Connect client socket. */ addr.sin_addr = pj_inet_addr(pj_cstr(&s, "127.0.0.1")); @@ -107,6 +111,7 @@ pj_status_t app_socketpair(int family, int type, int protocol, goto on_error; /* For TCP, must accept(), and get the new socket. */ +#if PJ_HAS_TCP if (type == PJ_SOCK_STREAM) { pj_sock_t newserver; @@ -118,6 +123,7 @@ pj_status_t app_socketpair(int family, int type, int protocol, pj_sock_close(sock[SERVER]); sock[SERVER] = newserver; } +#endif *serverfd = sock[SERVER]; *clientfd = sock[CLIENT]; |