if (inst->locking) {
lseek(outfd, 0L, SEEK_SET);
if (rad_lockfd_nonblock(outfd, 0) < 0) {
- close(outfd);
tv.tv_sec = 0;
tv.tv_usec = 25000;
select(0, NULL, NULL, NULL, &tv);
} while (!locked && inst->locking && lock_count < 80);
if (!locked && inst->locking && lock_count >= 80) {
+ close(outfd);
radlog(L_ERR, "rlm_detail: Failed to aquire filelock for %s, giving up",
buffer);
return RLM_MODULE_FAIL;
rad_unlockfd(outfd, 0);
DEBUG("rlm_detail: Released filelock");
}
- close(outfd);
+ close(outfd); /* automatically releases the lock */
return RLM_MODULE_FAIL;
}