Skip to content

Commit

Permalink
In some strange cases, lseek may return an error
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Apr 19, 2014
1 parent 90dcbfc commit 981bfc1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/modules/rlm_radutmp/rlm_radutmp.c
Expand Up @@ -410,7 +410,10 @@ static rlm_rcode_t mod_accounting(void *instance, REQUEST *request)
* Find the entry for this NAS / portno combination.
*/
if ((cache = nas_port_find(inst->nas_port_list, ut.nas_address, ut.nas_port)) != NULL) {
lseek(fd, (off_t)cache->offset, SEEK_SET);
if (lseek(fd, (off_t)cache->offset, SEEK_SET) < 0) {
rcode = RLM_MODULE_FAIL;
goto finish;
}
}

r = 0;
Expand Down

0 comments on commit 981bfc1

Please sign in to comment.