char *ans;
if (question_count == 0)
- /* FIXME: the Sun version uses for host name lookup an additional
- parameter for pointing to h_errno. this is missing here.
- OSF/1 has a per-thread h_errno variable. */
- if (header_pointer->aa != 0)
- {
- __set_h_errno (HOST_NOT_FOUND);
- return NSS_STATUS_NOTFOUND;
- }
- else
- {
- __set_h_errno (TRY_AGAIN);
- return NSS_STATUS_TRYAGAIN;
- }
+ {
+ /* FIXME: the Sun version uses for host name lookup an additional
+ parameter for pointing to h_errno. this is missing here.
+ OSF/1 has a per-thread h_errno variable. */
+ if (header_pointer->aa != 0)
+ {
+ __set_h_errno (HOST_NOT_FOUND);
+ return NSS_STATUS_NOTFOUND;
+ }
+ else
+ {
+ __set_h_errno (TRY_AGAIN);
+ return NSS_STATUS_TRYAGAIN;
+ }
+ }
/* Skip the question part. */
while (question_count-- > 0)
} /*foreach ns*/
} /*foreach retry*/
res_close();
- if (!v_circuit)
+ if (!v_circuit) {
if (!gotsomewhere)
__set_errno (ECONNREFUSED); /* no nameservers found */
else
__set_errno (ETIMEDOUT); /* no answer obtained */
- else
+ } else
__set_errno (terrno);
return (-1);
}
/* If any request is worked on by a thread it must be the first.
So either we can delete all requests or all but the first. */
if (req != NULL)
- if (req->running == allocated)
- {
- struct requestlist *old = req;
- req = req->next_prio;
- old->next_prio = NULL;
+ {
+ if (req->running == allocated)
+ {
+ struct requestlist *old = req;
+ req = req->next_prio;
+ old->next_prio = NULL;
- result = AIO_NOTCANCELED;
- }
- else
- {
- /* Remove entry from the file descriptor list. */
- if (req->last_fd != NULL)
- req->last_fd->next_fd = req->next_fd;
- if (req->next_fd != NULL)
- req->next_fd->last_fd = req->last_fd;
-
- result = AIO_CANCELED;
- }
+ result = AIO_NOTCANCELED;
+ }
+ else
+ {
+ /* Remove entry from the file descriptor list. */
+ if (req->last_fd != NULL)
+ req->last_fd->next_fd = req->next_fd;
+ if (req->next_fd != NULL)
+ req->next_fd->last_fd = req->last_fd;
+
+ result = AIO_CANCELED;
+ }
+ }
}
/* Mark requests as canceled and send signal. */
runp = runp->next_fd;
if (runp != NULL)
- if (runp->aiocbp->aiocb.aio_fildes != fildes)
- runp = NULL;
- else
- while (runp != NULL && runp->aiocbp != elem)
- runp = runp->next_prio;
+ {
+ if (runp->aiocbp->aiocb.aio_fildes != fildes)
+ runp = NULL;
+ else
+ while (runp != NULL && runp->aiocbp != elem)
+ runp = runp->next_prio;
+ }
return runp;
}