summaryrefslogtreecommitdiff
path: root/pcap_sg.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-04-22 19:26:11 +0300
committerTobias Klauser <tklauser@distanz.ch>2015-04-22 21:58:21 +0200
commit56d79391b748563cc5075b9d31fe199db8a2d093 (patch)
tree9718b110636556ac844637009e71606e61182eec /pcap_sg.c
parentc69c838def37d46008e85fdc2f817fc9fd70c4d5 (diff)
netsniff-ng: Don't set IO prio when reading pcap file
It allows to read pcap file for users who have no permissions to set process IO prio. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Acked-by: Daniel Borkmann <borkmann@iogearbox.net> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'pcap_sg.c')
-rw-r--r--pcap_sg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pcap_sg.c b/pcap_sg.c
index 9d07656..80c2c5d 100644
--- a/pcap_sg.c
+++ b/pcap_sg.c
@@ -145,9 +145,10 @@ static void pcap_sg_fsync(int fd)
fdatasync(fd);
}
-static void pcap_sg_init_once(void)
+static void pcap_sg_init_once(bool enforce_prio)
{
- set_ioprio_rt();
+ if (enforce_prio)
+ set_ioprio_rt();
}
static int pcap_sg_prepare_access(int fd, enum pcap_mode mode, bool jumbo)