summaryrefslogtreecommitdiff
path: root/gdb/inf-child.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/inf-child.c')
-rw-r--r--gdb/inf-child.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 713c9d43b55..084dfa1572c 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -204,41 +204,6 @@ inf_child_pid_to_exec_file (struct target_ops *self, int pid)
return NULL;
}
-
-/* Target file operations. */
-
-static int
-inf_child_fileio_open_flags_to_host (int fileio_open_flags, int *open_flags_p)
-{
- int open_flags = 0;
-
- if (fileio_open_flags & ~FILEIO_O_SUPPORTED)
- return -1;
-
- if (fileio_open_flags & FILEIO_O_CREAT)
- open_flags |= O_CREAT;
- if (fileio_open_flags & FILEIO_O_EXCL)
- open_flags |= O_EXCL;
- if (fileio_open_flags & FILEIO_O_TRUNC)
- open_flags |= O_TRUNC;
- if (fileio_open_flags & FILEIO_O_APPEND)
- open_flags |= O_APPEND;
- if (fileio_open_flags & FILEIO_O_RDONLY)
- open_flags |= O_RDONLY;
- if (fileio_open_flags & FILEIO_O_WRONLY)
- open_flags |= O_WRONLY;
- if (fileio_open_flags & FILEIO_O_RDWR)
- open_flags |= O_RDWR;
-/* On systems supporting binary and text mode, always open files in
- binary mode. */
-#ifdef O_BINARY
- open_flags |= O_BINARY;
-#endif
-
- *open_flags_p = open_flags;
- return 0;
-}
-
/* Open FILENAME on the target, using FLAGS and MODE. Return a
target file descriptor, or -1 if an error occurs (and set
*TARGET_ERRNO). */
@@ -250,7 +215,7 @@ inf_child_fileio_open (struct target_ops *self,
int nat_flags;
int fd;
- if (inf_child_fileio_open_flags_to_host (flags, &nat_flags) == -1)
+ if (fileio_to_host_openflags (flags, &nat_flags) == -1)
{
*target_errno = FILEIO_EINVAL;
return -1;