aboutsummaryrefslogtreecommitdiff
path: root/libiberty/lrealpath.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-08-12 09:36:48 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-08-12 07:36:48 +0000
commit8f88e7f6f8ed55effda60b6475d8dbcb247dd9a2 (patch)
treef18f3a9629c8672d0bed03509356c4ffe49ae772 /libiberty/lrealpath.c
parent90fb7fae3c84cafe73e0bd7e5bb02581c42c4840 (diff)
downloadgcc-8f88e7f6f8ed55effda60b6475d8dbcb247dd9a2.zip
gcc-8f88e7f6f8ed55effda60b6475d8dbcb247dd9a2.tar.gz
gcc-8f88e7f6f8ed55effda60b6475d8dbcb247dd9a2.tar.bz2
Move is_valid_fd to filedescriptor.c file.
2019-08-12 Martin Liska <mliska@suse.cz> * Makefile.in: Add filedescriptor.c. * filedescriptor.c: New file. * lrealpath.c (is_valid_fd): Remove. From-SVN: r274273
Diffstat (limited to 'libiberty/lrealpath.c')
-rw-r--r--libiberty/lrealpath.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c
index ac914a7..7f66dc2 100644
--- a/libiberty/lrealpath.c
+++ b/libiberty/lrealpath.c
@@ -49,9 +49,6 @@ components will be simplified. The returned value will be allocated using
#ifdef HAVE_STRING_H
#include <string.h>
#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
/* On GNU libc systems the declaration is only visible with _GNU_SOURCE. */
#if defined(HAVE_CANONICALIZE_FILE_NAME) \
@@ -158,16 +155,3 @@ lrealpath (const char *filename)
/* This system is a lost cause, just duplicate the filename. */
return strdup (filename);
}
-
-/* Return true when FD file descriptor exists. */
-
-int
-is_valid_fd (int fd)
-{
-#if defined(_WIN32)
- HANDLE h = (HANDLE) _get_osfhandle (fd);
- return h != (HANDLE) -1;
-#else
- return fcntl (fd, F_GETFD) >= 0;
-#endif
-}