aboutsummaryrefslogtreecommitdiff
path: root/libio/freopen.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-02-18 13:02:37 +0100
committerFlorian Weimer <fweimer@redhat.com>2020-02-18 13:42:29 +0100
commitfa185f0d4529c6d70f690306f431ca23662b9138 (patch)
treead2719a1dd633d74a7a61ad59eefd08c944e19c6 /libio/freopen.c
parente4a399921390509418826e8e8995d2441f29e243 (diff)
downloadglibc-fa185f0d4529c6d70f690306f431ca23662b9138.tar
glibc-fa185f0d4529c6d70f690306f431ca23662b9138.tar.gz
glibc-fa185f0d4529c6d70f690306f431ca23662b9138.tar.bz2
glibc-fa185f0d4529c6d70f690306f431ca23662b9138.zip
<fd_to_filename.h>: Add type safety and port to Hurd
The new type struct fd_to_filename makes the allocation of the backing storage explicit. Hurd uses /dev/fd, not /proc/self/fd. Co-Authored-By: Paul Eggert <eggert@cs.ucla.edu>
Diffstat (limited to 'libio/freopen.c')
-rw-r--r--libio/freopen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libio/freopen.c b/libio/freopen.c
index bab3ba204a..884cdb2961 100644
--- a/libio/freopen.c
+++ b/libio/freopen.c
@@ -37,7 +37,7 @@ FILE *
freopen (const char *filename, const char *mode, FILE *fp)
{
FILE *result = NULL;
- char fdfilename[FD_TO_FILENAME_SIZE];
+ struct fd_to_filename fdfilename;
CHECK_FILE (fp, NULL);
@@ -50,7 +50,7 @@ freopen (const char *filename, const char *mode, FILE *fp)
int fd = _IO_fileno (fp);
const char *gfilename
- = filename != NULL ? filename : fd_to_filename (fd, fdfilename);
+ = filename != NULL ? filename : __fd_to_filename (fd, &fdfilename);
fp->_flags2 |= _IO_FLAGS2_NOCLOSE;
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)