diff --git a/overlay_interface.c b/overlay_interface.c index 6efafea4..9a241a11 100644 --- a/overlay_interface.c +++ b/overlay_interface.c @@ -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");