From 18cac625e552ca0574ee8d8b674ef3d3ab29e450 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 15 Aug 2016 17:33:25 +0000 Subject: [PATCH] Assume that struct stat contains st_blksize, st_blocks, and st_rdev Our test suite already assumes that struct stat contains st_blksize, st_blocks, and st_rdev members, and there haven't been any complaints. * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_blksize, struct stat.st_blocks, and struct stat.st_rdev. * printstat.h (DO_PRINTSTAT): Do not check for HAVE_STRUCT_STAT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_BLOCKS, and HAVE_STRUCT_STAT_ST_RDEV. --- configure.ac | 5 +---- printstat.h | 10 ---------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 985bf076..d302afb4 100644 --- a/configure.ac +++ b/configure.ac @@ -337,14 +337,11 @@ AC_CHECK_TYPES(m4_normalize([ AC_CHECK_MEMBERS(m4_normalize([ struct stat.st_atim.tv_nsec, - struct stat.st_blksize, - struct stat.st_blocks, struct stat.st_ctim.tv_nsec, struct stat.st_flags, struct stat.st_fstype, struct stat.st_gen, - struct stat.st_mtim.tv_nsec, - struct stat.st_rdev + struct stat.st_mtim.tv_nsec ])) AC_CHECK_MEMBERS([struct timex.tai],,, [#include ]) diff --git a/printstat.h b/printstat.h index 562d5cad..0d139b45c 100644 --- a/printstat.h +++ b/printstat.h @@ -62,12 +62,8 @@ DO_PRINTSTAT(struct tcb *tcp, const STRUCT_STAT *statbuf) (unsigned int) statbuf->st_nlink, (unsigned int) statbuf->st_uid, (unsigned int) statbuf->st_gid); -#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE tprintf(", st_blksize=%u", (unsigned int) statbuf->st_blksize); -#endif -#ifdef HAVE_STRUCT_STAT_ST_BLOCKS tprintf(", st_blocks=%llu", widen_to_ull(statbuf->st_blocks)); -#endif } else { tprints("st_mode="); print_symbolic_mode_t(statbuf->st_mode); @@ -75,15 +71,9 @@ DO_PRINTSTAT(struct tcb *tcp, const STRUCT_STAT *statbuf) switch (statbuf->st_mode & S_IFMT) { case S_IFCHR: case S_IFBLK: -#ifdef HAVE_STRUCT_STAT_ST_RDEV tprintf(", st_rdev=makedev(%u, %u)", (unsigned int) STAT_MAJOR(statbuf->st_rdev), (unsigned int) STAT_MINOR(statbuf->st_rdev)); -#else /* !HAVE_STRUCT_STAT_ST_RDEV */ - tprintf(", st_size=makedev(%u, %u)", - (unsigned int) STAT_MAJOR(statbuf->st_size), - (unsigned int) STAT_MINOR(statbuf->st_size)); -#endif /* !HAVE_STRUCT_STAT_ST_RDEV */ break; default: tprintf(", st_size=%llu", widen_to_ull(statbuf->st_size)); -- 2.40.0