summaryrefslogtreecommitdiff
path: root/geoip.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-12 14:33:43 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-06-12 14:33:43 +0200
commitdfb45a7ac75d17c3a8421bfb53840d6db271a121 (patch)
tree3d9882f7c077d7ff431a1379f89f2115640ce201 /geoip.c
parent44b463529a8a9f2ccd1ec2acb8a4dfc117a636cb (diff)
ioops: misc: add dup{,2}_or_die to ioops
Bail out if it should ever fail. Detected by coverty in the translate_pcap_to_txf() path. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'geoip.c')
-rw-r--r--geoip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/geoip.c b/geoip.c
index b403ad1..d027e14 100644
--- a/geoip.c
+++ b/geoip.c
@@ -348,10 +348,10 @@ static int fdout, fderr;
static void geoip_open_prepare(void)
{
fflush(stdout);
- fdout = dup(1);
+ fdout = dup_or_die(1);
fflush(stderr);
- fderr = dup(2);
+ fderr = dup_or_die(2);
close(1);
close(2);
@@ -359,8 +359,8 @@ static void geoip_open_prepare(void)
static void geoip_open_restore(void)
{
- dup2(fdout, 1);
- dup2(fderr, 2);
+ dup2_or_die(fdout, 1);
+ dup2_or_die(fderr, 2);
close(fdout);
close(fderr);