summaryrefslogtreecommitdiff
path: root/resize/main.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1997-06-09 14:51:29 +0000
committerTheodore Ts'o <tytso@mit.edu>1997-06-09 14:51:29 +0000
commit1e1da29fbd4204a267ebd7c64d37e1f95a9dad08 (patch)
tree33736a3b078756254de95cdb9e87583fe620fcc7 /resize/main.c
parent24b2c7a7a14cec8480a75af7d535cf267e6abe1f (diff)
downloade2fsprogs-1e1da29fbd4204a267ebd7c64d37e1f95a9dad08.tar.gz
Many files:
bmove.c (ext2fs_move_blocks): New function which takes a bitmap of blocks which need to be moved, and moves those blocks to another location in the filesystem. rs_bitmap.c (ext2fs_resize_generic_bitmap): When expanding a bitmap, make sure all of the new parts of the bitmap are zero. bitmaps.c (ext2fs_copy_bitmap): Fix bug; the destination bitmap wasn't being returned to the caller. alloc_tables.c (ext2fs_allocate_group_table): Add new function ext2fs_allocate_group_table() which sets the group tables for a particular block group. The relevant code was factored out of ext2fs_allocate_tables(). dblist.c (make_dblist): Adjust the initial size of the directory block list to be a bit more realize (ten plus twice the number of directories in the filesystem). Check in interim work.
Diffstat (limited to 'resize/main.c')
-rw-r--r--resize/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/resize/main.c b/resize/main.c
index b664664c..d8b22001 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -49,13 +49,13 @@ void main (int argc, char ** argv)
device_name = argv[optind++];
new_size = atoi(argv[optind++]);
initialize_ext2_error_table();
-#if 1
+#if 0
io_ptr = unix_io_manager;
#else
io_ptr = test_io_manager;
test_io_backing_manager = unix_io_manager;
#endif
- retval = ext2fs_open (device_name, 0, 0, 0,
+ retval = ext2fs_open (device_name, EXT2_FLAG_RW, 0, 0,
io_ptr, &fs);
if (retval) {
com_err (program_name, retval, "while trying to open %s",
@@ -70,7 +70,11 @@ void main (int argc, char ** argv)
ext2fs_close (fs);
exit (1);
}
- resize_fs(fs, new_size);
- ext2fs_close (fs);
+ retval = resize_fs(fs, new_size);
+ if (retval) {
+ com_err(program_name, retval, "while trying to resize %s",
+ device_name);
+ ext2fs_close (fs);
+ }
exit (0);
}