diff options
author | Theodore Ts'o <tytso@mit.edu> | 1997-04-29 16:15:03 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 1997-04-29 16:15:03 +0000 |
commit | 21c84b71e205b5ab13f14343da5645dcc985856d (patch) | |
tree | cc2158df261634459b5364f27cdd0298a9260179 /lib/e2p | |
parent | f45a038dbe59be10c4d6d58f1108f67a216192bc (diff) | |
download | e2fsprogs-21c84b71e205b5ab13f14343da5645dcc985856d.tar.gz |
Many files:
Checked in e2fsprogs-1.07
Diffstat (limited to 'lib/e2p')
-rw-r--r-- | lib/e2p/ChangeLog | 18 | ||||
-rw-r--r-- | lib/e2p/Makefile.in | 3 | ||||
-rw-r--r-- | lib/e2p/dll/jump.funcs | 28 | ||||
-rw-r--r-- | lib/e2p/ls.c | 76 | ||||
-rw-r--r-- | lib/e2p/uuid.c | 3 |
5 files changed, 82 insertions, 46 deletions
diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index a9a8f41a..9b18c363 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,3 +1,21 @@ +Wed Mar 12 13:32:05 1997 Theodore Y. Ts'o <tytso@mit.edu> + + * Release of E2fsprogs version 1.07 + +Thu Jan 2 00:06:29 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> + + * uuid.c: Include string.h, since we use memcpy(). + +Wed Jan 1 23:47:22 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> + + * ls.c (list_super): Copy times from the superblock to a time_t + variable. (The alpha has different sizes for time_t and + the time in the superblock.) + +Tue Oct 8 02:02:03 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> + + * Release of E2fsprogs version 1.06 + Sun Sep 22 16:20:12 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * pf.c: Add support for the 'A' (no atime) flag. diff --git a/lib/e2p/Makefile.in b/lib/e2p/Makefile.in index 4c433dcd..f78c98de 100644 --- a/lib/e2p/Makefile.in +++ b/lib/e2p/Makefile.in @@ -45,6 +45,7 @@ ELF_SO_VERSION = 2 ELF_IMAGE = libe2p ELF_MYDIR = e2p ELF_INSTALL_DIR = $(libdir) +ELF_OTHER_LIBS = -lc BSDLIB_VERSION = 2.1 BSDLIB_IMAGE = libe2p @@ -60,7 +61,7 @@ BSDLIB_INSTALL_DIR = $(libdir) .c.o: $(CC) $(ALL_CFLAGS) -c $< -o $@ -@PROFILE_CMT@ $(CC) $(ALL_CFLAGS) -pg -o profiled/$*.o -c $< +@PROFILE_CMT@ $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $< @CHECKER_CMT@ $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $< @DLL_CMT@ (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(ALL_CFLAGS) \ @DLL_CMT@ -o jump/$*.o -c $<) diff --git a/lib/e2p/dll/jump.funcs b/lib/e2p/dll/jump.funcs index 61a69fb6..6173ddc2 100644 --- a/lib/e2p/dll/jump.funcs +++ b/lib/e2p/dll/jump.funcs @@ -1,13 +1,15 @@ -00000000 T _fgetflags libe2p jump/fgetflags -00000000 T _fsetflags libe2p jump/fsetflags -00000000 T _fgetversion libe2p jump/fgetversion -00000000 T _fsetversion libe2p jump/fsetversion -00000000 T _getflags libe2p jump/getflags -00000000 T _getversion libe2p jump/getversion -00000000 T _iterate_on_dir libe2p jump/iod -00000000 T _list_super libe2p jump/ls -00000000 T _print_fs_errors libe2p jump/pe -00000000 T _print_flags libe2p jump/pf -00000000 T _print_fs_state libe2p jump/ps -00000000 T _setflags libe2p jump/setflags -00000000 T _setversion libe2p jump/setversion +00000000 T _fgetflags libe2p fgetflags +00000000 T _fsetflags libe2p fsetflags +00000000 T _fgetversion libe2p fgetversion +00000000 T _fsetversion libe2p fsetversion +00000000 T _getflags libe2p getflags +00000000 T _getversion libe2p getversion +00000000 T _iterate_on_dir libe2p iod +00000000 T _list_super libe2p ls +00000000 T _print_fs_errors libe2p pe +00000000 T _print_flags libe2p pf +00000000 T _print_fs_state libe2p ps +00000000 T _setflags libe2p setflags +00000000 T _setversion libe2p setversion +00000000 T _e2p_is_null_uuid libe2p uuid +00000000 T _e2p_uuid_to_str libe2p uuid diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c index 55e0bbe6..a1320472 100644 --- a/lib/e2p/ls.c +++ b/lib/e2p/ls.c @@ -5,6 +5,8 @@ * Laboratoire MASI, Institut Blaise Pascal * Universite Pierre et Marie Curie (Paris VI) * + * Copyright (C) 1995, 1996, 1997 Theodore Ts'o <tytso@mit.edu> + * * This file can be redistributed under the terms of the GNU Library General * Public License */ @@ -104,13 +106,16 @@ static void print_group (unsigned short gid) #define HOUR_INT (60 * 60) #define MINUTE_INT (60) -static char *interval_string(unsigned int secs) +static const char *interval_string(unsigned int secs) { static char buf[256], tmp[80]; int hr, min, num; buf[0] = 0; + if (secs == 0) + return "<none>"; + if (secs >= MONTH_INT) { num = secs / MONTH_INT; secs -= num*MONTH_INT; @@ -153,6 +158,7 @@ void list_super (struct ext2_super_block * s) struct ext2fs_sb *sb = (struct ext2fs_sb *) s; char buf[80]; const char *os; + time_t tm; inode_blocks_per_group = (((s->s_inodes_per_group * EXT2_INODE_SIZE(s)) + @@ -163,17 +169,20 @@ void list_super (struct ext2_super_block * s) if (sb->s_volume_name[0]) { memset(buf, 0, sizeof(buf)); strncpy(buf, sb->s_volume_name, sizeof(sb->s_volume_name)); - printf("Filesystem volume name: %s\n", buf); - } + } else + strcpy(buf, "<none>"); + printf("Filesystem volume name: %s\n", buf); if (sb->s_last_mounted[0]) { memset(buf, 0, sizeof(buf)); strncpy(buf, sb->s_last_mounted, sizeof(sb->s_last_mounted)); - printf("Last mounted on: %s\n", buf); - } + } else + strcpy(buf, "<not available>"); + printf("Last mounted on: %s\n", buf); if (!e2p_is_null_uuid(sb->s_uuid)) { e2p_uuid_to_str(sb->s_uuid, buf); - printf("Filesystem UUID: %s\n", buf); - } + } else + strcpy(buf, "<none>"); + printf("Filesystem UUID: %s\n", buf); printf ("Filesystem state: "); print_fs_state (stdout, s->s_state); printf ("\n"); @@ -186,38 +195,41 @@ void list_super (struct ext2_super_block * s) case EXT2_OS_MASIX: os = "Masix"; break; default: os = "unknown"; break; } - printf ("Filesystem OS type: %s\n", os); - printf ("Inode count: %u\n", s->s_inodes_count); - printf ("Block count: %u\n", s->s_blocks_count); - printf ("Reserved block count: %u\n", s->s_r_blocks_count); - printf ("Free blocks: %u\n", s->s_free_blocks_count); - printf ("Free inodes: %u\n", s->s_free_inodes_count); - printf ("First block: %u\n", s->s_first_data_block); - printf ("Block size: %u\n", EXT2_BLOCK_SIZE(s)); - printf ("Fragment size: %u\n", EXT2_FRAG_SIZE(s)); - printf ("Blocks per group: %u\n", s->s_blocks_per_group); - printf ("Fragments per group: %u\n", s->s_frags_per_group); - printf ("Inodes per group: %u\n", s->s_inodes_per_group); - printf ("Inode blocks per group: %u\n", inode_blocks_per_group); - printf ("Last mount time: %s", ctime ((time_t *) &s->s_mtime)); - printf ("Last write time: %s", ctime ((time_t *) &s->s_wtime)); - printf ("Mount count: %u\n", s->s_mnt_count); - printf ("Maximum mount count: %d\n", s->s_max_mnt_count); - printf ("Last checked: %s", ctime ((time_t *) &s->s_lastcheck)); - printf ("Check interval: %u (%s)\n", s->s_checkinterval, - interval_string(s->s_checkinterval)); + printf("Filesystem OS type: %s\n", os); + printf("Inode count: %u\n", s->s_inodes_count); + printf("Block count: %u\n", s->s_blocks_count); + printf("Reserved block count: %u\n", s->s_r_blocks_count); + printf("Free blocks: %u\n", s->s_free_blocks_count); + printf("Free inodes: %u\n", s->s_free_inodes_count); + printf("First block: %u\n", s->s_first_data_block); + printf("Block size: %u\n", EXT2_BLOCK_SIZE(s)); + printf("Fragment size: %u\n", EXT2_FRAG_SIZE(s)); + printf("Blocks per group: %u\n", s->s_blocks_per_group); + printf("Fragments per group: %u\n", s->s_frags_per_group); + printf("Inodes per group: %u\n", s->s_inodes_per_group); + printf("Inode blocks per group: %u\n", inode_blocks_per_group); + tm = s->s_mtime; + printf("Last mount time: %s", ctime(&tm)); + tm = s->s_wtime; + printf("Last write time: %s", ctime(&tm)); + printf("Mount count: %u\n", s->s_mnt_count); + printf("Maximum mount count: %d\n", s->s_max_mnt_count); + tm = s->s_lastcheck; + printf("Last checked: %s", ctime(&tm)); + printf("Check interval: %u (%s)\n", s->s_checkinterval, + interval_string(s->s_checkinterval)); if (s->s_checkinterval) { time_t next; next = s->s_lastcheck + s->s_checkinterval; - printf ("Next check after: %s", ctime (&next)); + printf("Next check after: %s", ctime(&next)); } #ifdef EXT2_DEF_RESUID - printf ("Reserved blocks uid: "); - print_user (s->s_def_resuid); - printf ("Reserved blocks gid: "); - print_group (s->s_def_resgid); + printf("Reserved blocks uid: "); + print_user(s->s_def_resuid); + printf("Reserved blocks gid: "); + print_group(s->s_def_resgid); #endif #ifdef EXT2_DYNAMIC_REV if (s->s_rev_level >= EXT2_DYNAMIC_REV) { diff --git a/lib/e2p/uuid.c b/lib/e2p/uuid.c index 82462e83..39082a68 100644 --- a/lib/e2p/uuid.c +++ b/lib/e2p/uuid.c @@ -3,8 +3,11 @@ */ #include <stdio.h> +#include <string.h> #include <linux/types.h> +#include "e2p.h" + struct uuid { __u32 time_low; __u16 time_mid; |