Branch Coverage

os_unix.c
Criterion Covered Total %
branch 32 206 15.5


line true false branch
121 0 6 if (force || sa.sa_handler == SIG_DFL)
0 0 if (force || sa.sa_handler == SIG_DFL)
162 0 3 if(libInitialized)
166 0 3 if(asyncIoTable == NULL) {
202 0 0 if(!libInitialized)
240 0 2 if(bindPathLen > sizeof(servAddrPtr->sun_path)) {
289 0 2 if (strlen(bindPath) >= MAXPATHLEN) {
296 0 2 if((tp = strchr(host, ':')) != 0) {
298 0 0 if((port = atoi(tp)) == 0) {
304 0 2 if(tcp) {
305 0 0 if (!*host || !strcmp(host,"*")) {
0 0 if (!*host || !strcmp(host,"*")) {
309 0 0 if (tcp_ia == INADDR_NONE) {
312 0 0 if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) {
0 0 if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) {
0 0 if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) {
316 0 0 if (hep->h_addr_list[1]) {
326 0 2 if(tcp) {
328 0 0 if(listenSock >= 0) {
330 0 0 if(setsockopt(listenSock, SOL_SOCKET, SO_REUSEADDR,
339 0 2 if(listenSock < 0) {
346 0 2 if(tcp) {
354 0 2 if(OS_BuildSockAddrUn(bindPath, &sa.unixVariant, &servLen)) {
359 2 0 if(bind(listenSock, (struct sockaddr *) &sa.unixVariant, servLen) < 0
360 0 2 || listen(listenSock, backlog) < 0) {
398 0 0 if (strlen(bindPath) >= MAXPATHLEN) {
403 0 0 if((tp = strchr(host, ':')) != 0) {
405 0 0 if((port = atoi(tp)) == 0) {
411 0 0 if(tcp == TRUE) {
413 0 0 if((hp = gethostbyname((*host ? host : "localhost"))) == NULL) {
0 0 if((hp = gethostbyname((*host ? host : "localhost"))) == NULL) {
423 0 0 if(OS_BuildSockAddrUn(bindPath, &sa.unixVariant, &servLen)) {
430 0 0 ASSERT(resultSock >= 0);
433 0 0 if(connectStatus >= 0) {
463 0 2 if (shutdownNow) return -1;
485 0 6 if (shutdownNow) return -1;
509 0 0 if(forkResult < 0) {
513 0 0 if(forkResult == 0) {
530 0 0 if(listenFd != FCGI_LISTENSOCK_FILENO) {
581 0 0 ASSERT(asyncIoTable[index].inUse == 0);
590 0 0 if(STDIN_FILENO > maxFd)
601 0 0 if(asyncIoTable == NULL) {
639 0 0 ASSERT(asyncIoTable != NULL);
642 0 0 if(fd > maxFd)
645 0 0 while (index >= asyncIoTableSize) {
649 0 0 ASSERT(asyncIoTable[index].inUse == 0);
691 0 0 if(fd > maxFd)
694 0 0 while (index >= asyncIoTableSize) {
698 0 0 ASSERT(asyncIoTable[index].inUse == 0);
728 2 2 if (fd == -1)
731 0 2 if (asyncIoInUse) {
736 0 0 if (asyncIoTable[index].inUse != 0) {
743 0 0 if (asyncIoTable[index].inUse != 0) {
747 0 0 if (maxFd == fd) {
760 2 0 if (shutdown_ok)
762 2 0 if (shutdown(fd, 1) == 0)
778 2 0 while (rv > 0 && read(fd, trash, sizeof(trash)) > 0);
0 2 while (rv > 0 && read(fd, trash, sizeof(trash)) > 0);
801 0 0 if(asyncIoTable[AIO_RD_IX(fd)].inUse != 0) {
839 0 0 for(fd = 0; fd <= maxFd; fd++) {
840 0 0 if(FD_ISSET(fd, &readFdSet)) {
843 0 0 if(FD_ISSET(fd, &writeFdSet)) {
852 0 0 if(numRdPosted == 0 && numWrPosted == 0) {
0 0 if(numRdPosted == 0 && numWrPosted == 0) {
855 0 0 if(selectStatus < 0) {
859 0 0 for(fd = 0; fd <= maxFd; fd++) {
865 0 0 if(FD_ISSET(fd, &readFdSetCpy)) {
871 0 0 if(FD_ISSET(fd, &writeFdSetCpy)) {
879 0 0 if(numRdPosted == 0 && numWrPosted == 0)
0 0 if(numRdPosted == 0 && numWrPosted == 0)
882 0 0 for(fd = 0; fd <= maxFd; fd++) {
886 0 0 if(FD_ISSET(fd, &readFdSetPost)
887 0 0 && asyncIoTable[AIO_RD_IX(fd)].inUse) {
906 0 0 if(FD_ISSET(fd, &writeFdSetPost) &&
0 0 if(FD_ISSET(fd, &writeFdSetPost) &&
933 0 0 if (sdup)
957 0 0 if (clientList == NULL || *clientList == '\0') {
0 0 if (clientList == NULL || *clientList == '\0') {
963 0 0 for (cur = clientListCopy; cur != NULL; cur = next) {
965 0 0 if (next != NULL) {
968 0 0 if (inet_addr(cur) == saPtr->sin_addr.s_addr) {
1064 0 0 switch (error) {
1132 2 0 return select(fd + 1, &read_fds, NULL, NULL, &tval) >= 0 && FD_ISSET(fd, &read_fds);
2 0 return select(fd + 1, &read_fds, NULL, NULL, &tval) >= 0 && FD_ISSET(fd, &read_fds);
1160 0 2 if (AcquireLock(listen_sock, fail_on_intr))
1170 0 2 if (shutdownPending) break;
1175 0 0 && errno == EINTR
1176 0 0 && ! fail_on_intr
1177 0 2 && ! shutdownPending);
0 0 && ! shutdownPending);
1179 0 2 if (socket < 0) {
1180 0 0 if (shutdownPending || ! is_reasonable_accept_errno(errno)) {
0 0 if (shutdownPending || ! is_reasonable_accept_errno(errno)) {
1185 0 0 if (! shutdownPending) {
1196 2 0 if (sa.in.sin_family != AF_INET)
1205 0 0 if (ClientAddrOK(&sa.in, webServerAddrs))
1212 0 2 if (ReleaseLock(listen_sock))
1215 2 0 if (sa.in.sin_family != AF_UNIX || is_af_unix_keeper(socket))
0 2 if (sa.in.sin_family != AF_UNIX || is_af_unix_keeper(socket))
1273 0 0 if (getpeername(sock, (struct sockaddr *)&sa, &len) != 0 && errno == ENOTCONN) {
0 0 if (getpeername(sock, (struct sockaddr *)&sa, &len) != 0 && errno == ENOTCONN) {
1293 0 0 if((val = fcntl(fd, F_GETFL, 0)) < 0) {
1297 0 0 if(fcntl(fd, F_SETFL, val) < 0) {