mirror of
https://passt.top/passt
synced 2025-06-01 13:55:38 +02:00
treewide: Fix android-cloexec-* clang-tidy warnings, re-enable checks
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
ad7f57a5b7
commit
62c3edd957
8 changed files with 30 additions and 31 deletions
5
pcap.c
5
pcap.c
|
@ -170,6 +170,7 @@ fail:
|
|||
*/
|
||||
void pcap_init(struct ctx *c)
|
||||
{
|
||||
int flags = O_WRONLY | O_CREAT | O_TRUNC;
|
||||
struct timeval tv;
|
||||
|
||||
if (pcap_fd != -1)
|
||||
|
@ -200,8 +201,8 @@ void pcap_init(struct ctx *c)
|
|||
strncpy(c->pcap, name, PATH_MAX);
|
||||
}
|
||||
|
||||
pcap_fd = open(c->pcap, O_WRONLY | O_CREAT | O_TRUNC,
|
||||
S_IRUSR | S_IWUSR);
|
||||
flags |= c->foreground ? O_CLOEXEC : 0;
|
||||
pcap_fd = open(c->pcap, flags, S_IRUSR | S_IWUSR);
|
||||
if (pcap_fd == -1) {
|
||||
perror("open");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue