int main (int argc, char ** argv) { errcode_t retval; ext2_filsys fs; io_manager io_ptr; initialize_ext2_error_table(); blkid_get_cache(&cache, NULL); PRS(argc, argv); #ifdef CONFIG_TESTIO_DEBUG io_ptr = test_io_manager; test_io_backing_manager = unix_io_manager; #else io_ptr = unix_io_manager; #endif retval = ext2fs_open (device_name, open_flag, 0, 0, io_ptr, &fs); if (retval) exit(1); if (root_type) get_root_type(fs); return (ext2fs_close (fs) ? 1 : 0); }
int main (int argc, char ** argv) { errcode_t retval; ext2_filsys fs; io_manager io_ptr; add_error_table(&et_ext2_error_table); blkid_get_cache(&cache, NULL); PRS(argc, argv); #ifdef CONFIG_TESTIO_DEBUG if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) { io_ptr = test_io_manager; test_io_backing_manager = unix_io_manager; } else #endif io_ptr = unix_io_manager; retval = ext2fs_open (device_name, open_flag, 0, 0, io_ptr, &fs); if (retval) exit(1); if (root_type) get_root_type(fs); remove_error_table(&et_ext2_error_table); return (ext2fs_close (fs) ? 1 : 0); }
int check_in_rootfs(const char *mount_point, const char *msg_title, int format) { struct statfs sf; if (statfs(mount_point, &sf) == 0) { if(sf.f_type != get_root_type()) { // already mounted notice_set(msg_title, format ? "Formatted" : "Loaded"); return 0; } } return 1; }