#!/bin/sh -e ## ctime-type_pruned.dpatch by Goswin von Brederlow ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. if [ $# -lt 1 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 fi [ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts patch_opts="${patch_opts:--f --no-backup-if-mismatch}" case "$1" in -patch) patch $patch_opts -p1 < $0;; -unpatch) patch $patch_opts -p1 -R < $0;; *) echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1;; esac exit 0 @DPATCH@ --- defrag-0.73pjm1.old/e2dump.c 2006-03-11 18:04:58.570528000 +0000 +++ defrag-0.73pjm1.new/e2dump.c 2006-03-11 18:32:17.073438440 +0000 @@ -449,6 +449,7 @@ static void dump_super(void) { + time_t t; printf("SUPERBLOCK:\n"); printf("Inodes count:%lu\n", (unsigned long) s.s_inodes_count); /* Inodes count */ @@ -470,10 +471,10 @@ (unsigned long) s.s_frags_per_group); /* # Fragments per group */ printf("Inodes per group:%lu\n", (unsigned long) s.s_inodes_per_group); /* # Inodes per group */ - printf("mount time:%s", - ctime ((time_t *) &s.s_mtime)); /* Mount time */ - printf("write time:%s", - ctime ((time_t *) &s.s_wtime)); /* Write time */ + t = s.s_mtime; + printf("mount time:%s", ctime (&t)); /* Mount time */ + t = s.s_wtime; + printf("write time:%s", ctime (&t)); /* Write time */ printf("magic:0x%X", s.s_magic); /* Magic signature */ if (s.s_magic == EXT2_SUPER_MAGIC) printf(" (OK)\n"); else printf(" (???) "); @@ -488,6 +489,7 @@ those when on a 64-bit system, though that requires some autoconf magic to find the right printf directive. */ struct ext2_inode n; + time_t t; printf("\nINODE %lu\n", (unsigned long) inode_no); load_inode(&n,inode_no); @@ -503,17 +505,22 @@ printf("Owner Uid %d ",(uint) n.i_uid); printf("Group Id %d\n",(uint) n.i_gid); printf("File size %lu\n", (unsigned long) n.i_size); - printf("Access time : %s", ctime ((time_t *) &n.i_atime)); - printf("Creation time : %s", ctime ((time_t *) &n.i_ctime)); - printf("Modification time: %s", ctime ((time_t *) &n.i_mtime)); + t = n.i_atime; + printf("Access time : %s", ctime (&t)); + t = n.i_ctime; + printf("Creation time : %s", ctime (&t)); + t = n.i_mtime; + printf("Modification time: %s", ctime (&t)); if (inode_is_busy(inode_no)) { if (n.i_dtime!=0) printf("ERROR: bitmap is 1 "); } else if (n.i_dtime==0 && n.i_ctime!=0) printf("ERROR: bitmap is 0\n "); - if (n.i_dtime!=0) - printf("Deletion time : %s", ctime ((time_t *) &n.i_dtime)); + if (n.i_dtime!=0) { + t = n.i_dtime; + printf("Deletion time : %s", ctime (&t)); + } printf("Links count: %d\n", (uint) n.i_links_count); /* in 512 byte blocks for some unknown reason */ printf("512-Blocks count: %lu\n", (unsigned long) n.i_blocks);