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.
This commit is contained in:
Дмитрий Левин 2018-02-27 13:14:38 +00:00
parent 413c085e59
commit 42bedfc093
3 changed files with 5 additions and 8 deletions

View File

@ -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

View 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;

View File

@ -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();