mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-20 05:37:57 +00:00
don't complain if packet radio interface doesn't support fseek().
This commit is contained in:
parent
f2025cd601
commit
a42c685715
@ -751,10 +751,14 @@ overlay_broadcast_ensemble(overlay_interface *interface,
|
||||
only purpose is to find out the offset to print in the DEBUG statement. It is vulnerable
|
||||
to a race condition with other processes appending to the same file. */
|
||||
off_t fsize = lseek(interface->alarm.poll.fd, (off_t) 0, SEEK_END);
|
||||
if (fsize == -1)
|
||||
return WHY_perror("lseek");
|
||||
if (config.debug.overlayinterfaces)
|
||||
DEBUGF("Write to interface %s at offset=%d", interface->name, fsize);
|
||||
/* Don't complain if the seek fails because we are writing to a pipe or device that does
|
||||
not support seeking. */
|
||||
if (errno!=ESPIPE) {
|
||||
if (fsize == -1)
|
||||
return WHY_perror("lseek");
|
||||
if (config.debug.overlayinterfaces)
|
||||
DEBUGF("Write to interface %s at offset=%d", interface->name, fsize);
|
||||
}
|
||||
ssize_t nwrite = write(interface->alarm.poll.fd, &packet, sizeof(packet));
|
||||
if (nwrite == -1)
|
||||
return WHY_perror("write");
|
||||
|
Loading…
Reference in New Issue
Block a user