summaryrefslogtreecommitdiffstats
path: root/gl/dup-safer.c
diff options
context:
space:
mode:
Diffstat (limited to 'gl/dup-safer.c')
-rw-r--r--gl/dup-safer.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/gl/dup-safer.c b/gl/dup-safer.c
index 7d9b2be3..33f599be 100644
--- a/gl/dup-safer.c
+++ b/gl/dup-safer.c
@@ -1,7 +1,6 @@
1/* Invoke dup, but avoid some glitches. 1/* Invoke dup, but avoid some glitches.
2 2
3 Copyright (C) 2001, 2004, 2005, 2006, 2009 Free Software 3 Copyright (C) 2001, 2004-2006, 2009-2010 Free Software Foundation, Inc.
4 Foundation, Inc.
5 4
6 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -23,7 +22,6 @@
23#include "unistd-safer.h" 22#include "unistd-safer.h"
24 23
25#include <fcntl.h> 24#include <fcntl.h>
26
27#include <unistd.h> 25#include <unistd.h>
28 26
29/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or 27/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or
@@ -32,11 +30,5 @@
32int 30int
33dup_safer (int fd) 31dup_safer (int fd)
34{ 32{
35#if defined F_DUPFD && !defined FCHDIR_REPLACEMENT
36 return fcntl (fd, F_DUPFD, STDERR_FILENO + 1); 33 return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
37#else
38 /* fd_safer calls us back, but eventually the recursion unwinds and
39 does the right thing. */
40 return fd_safer (dup (fd));
41#endif
42} 34}