Skip to content

Commit

Permalink
Ignore write() return values
Browse files Browse the repository at this point in the history
  • Loading branch information
pipe01 committed Oct 14, 2024
1 parent 9064011 commit 0b6344f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pcap_t *pcap_create(const char *path)
.snaplen = 65535,
.network = LINKTYPE_BLUETOOTH_LE_LL,
};
write(fd, &hdr, sizeof(hdr));
(void)write(fd, &hdr, sizeof(hdr));

return pcap;
}
Expand All @@ -77,7 +77,7 @@ void pcap_write_packet(pcap_t *pcap, const uint8_t *data, size_t length)
.orig_len = length,
};

write(pcap->fd, &hdr, sizeof(hdr));
write(pcap->fd, data, length);
(void)write(pcap->fd, &hdr, sizeof(hdr));
(void)write(pcap->fd, data, length);
fsync(pcap->fd);
}

0 comments on commit 0b6344f

Please sign in to comment.