]> granicus.if.org Git - strace/commitdiff
Replace fopen_for_input and fopen_for_output with fopen_stream
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Feb 2018 13:14:38 +0000 (13:14 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Feb 2018 13:14:38 +0000 (13:14 +0000)
* largefile_wrappers.h (fopen_for_input, fopen_for_output): Replace
with fopen_stream.
* mmap_cache.c (fopen_for_input) Likewise.
* strace.c (fopen_for_output): Likewise.

largefile_wrappers.h
mmap_cache.c
strace.c

index 2cdd5ad975d7b6da23b52ada4048db25a64bfe8d..b5e49ad50c4af13c73468dcb44d0421ec2719cf8 100644 (file)
 
 #ifdef _LARGEFILE64_SOURCE
 # ifdef HAVE_FOPEN64
-#  define fopen_for_input fopen64
-#  define fopen_for_output fopen64
+#  define fopen_stream fopen64
 # else
-#  define fopen_for_input fopen
-#  define fopen_for_output fopen
+#  define fopen_stream fopen
 # endif
 # define struct_stat struct stat64
 # define stat_file stat64
@@ -48,8 +46,7 @@
 # define struct_rlimit struct rlimit64
 # define set_rlimit setrlimit64
 #else
-# define fopen_for_input fopen
-# define fopen_for_output fopen
+# define fopen_stream fopen
 # define struct_stat struct stat
 # define stat_file stat
 # define struct_dirent struct dirent
index 8db57991be7131b25233c39bb0a0794f9fd9830e..19f88abe35f7a1d67d863a56c662017c5fc67174 100644 (file)
@@ -62,7 +62,7 @@ build_mmap_cache(struct tcb *tcp)
        char buffer[PATH_MAX + 80];
 
        xsprintf(filename, "/proc/%u/maps", tcp->pid);
-       fp = fopen_for_input(filename, "r");
+       fp = fopen_stream(filename, "r");
        if (!fp) {
                perror_msg("fopen: %s", filename);
                return;
index 2eb520bd9ae9e0b79efe94b264f181ae08e9bb2e..eac5ab8f872843b7e5e1a7ef02f9140349dcffaf 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -455,7 +455,7 @@ strace_fopen(const char *path)
        FILE *fp;
 
        swap_uid();
-       fp = fopen_for_output(path, "w");
+       fp = fopen_stream(path, "w");
        if (!fp)
                perror_msg_and_die("Can't fopen '%s'", path);
        swap_uid();