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.
This commit is contained in:
Дмитрий Левин 2016-08-15 17:33:25 +00:00
parent 472ce30535
commit 18cac625e5
2 changed files with 1 additions and 14 deletions

View File

@ -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 <sys/timex.h>])

View File

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