From: Dmitry V. Levin Date: Tue, 27 Feb 2018 13:14:38 +0000 (+0000) Subject: Replace fopen_for_input and fopen_for_output with fopen_stream X-Git-Tag: v4.22~144 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42bedfc093f51ec3150484bbe519036cae701b61;p=strace Replace fopen_for_input and fopen_for_output with fopen_stream * 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. --- diff --git a/largefile_wrappers.h b/largefile_wrappers.h index 2cdd5ad9..b5e49ad5 100644 --- a/largefile_wrappers.h +++ b/largefile_wrappers.h @@ -35,11 +35,9 @@ #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 diff --git a/mmap_cache.c b/mmap_cache.c index 8db57991..19f88abe 100644 --- a/mmap_cache.c +++ b/mmap_cache.c @@ -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; diff --git a/strace.c b/strace.c index 2eb520bd..eac5ab8f 100644 --- 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();