]> granicus.if.org Git - strace/commitdiff
Assume that struct stat contains st_blksize, st_blocks, and st_rdev
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 15 Aug 2016 17:33:25 +0000 (17:33 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 15 Aug 2016 19:06:06 +0000 (22:06 +0300)
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
printstat.h

index 985bf076529dadce179a5f46901a3e6c6ef556e7..d302afb4c4bf99fdca40eb97dae25c97333a328a 100644 (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>])
index 562d5cadf50eaf2371c1208d19a865a74bf663bd..0d139b45cecc031cdd799a40438ef8619f03a549 100644 (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));