Changeset 4727a97a in mainline
- Timestamp:
- 2011-03-08T19:59:38Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0b07acd
- Parents:
- f0ceb1d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkminix/mkminix.c
rf0ceb1d r4727a97a 49 49 #include <mem.h> 50 50 #include <str.h> 51 #include <time.h> 51 52 #include <minix.h> 52 53 … … 299 300 const int chunks = sb->block_size / MFS_BLOCKSIZE; 300 301 301 for (i = 0; i < sb->itable_size; ++i, ++itable_pos)302 for (i = 0; i < sb->itable_size; ++i, itable_pos += chunks) 302 303 block_write_direct(sb->handle, itable_pos, chunks, itable_buf); 303 304 … … 308 309 { 309 310 struct mfs_inode *ino_buf; 310 const size_t bufsize = MFS_BLOCKSIZE;311 311 const long itable_pos = 2 + sb->zbmap_blocks + sb->ibmap_blocks; 312 312 313 ino_buf = (struct mfs_inode *) malloc(bufsize); 314 memset(ino_buf, 0x00, bufsize); 313 const time_t sec = time(NULL); 314 315 ino_buf = (struct mfs_inode *) malloc(MFS_BLOCKSIZE); 316 memset(ino_buf, 0x00, MFS_BLOCKSIZE); 315 317 316 318 ino_buf[MFS_ROOT_INO].i_mode = S_IFDIR; … … 318 320 ino_buf[MFS_ROOT_INO].i_gid = 0; 319 321 ino_buf[MFS_ROOT_INO].i_size = (sb->longnames ? MFSL_DIRSIZE : MFS_DIRSIZE) * 2; 320 ino_buf[MFS_ROOT_INO].i_mtime = 0;322 ino_buf[MFS_ROOT_INO].i_mtime = sec; 321 323 ino_buf[MFS_ROOT_INO].i_nlinks = 2; 322 324 ino_buf[MFS_ROOT_INO].i_dzone[0] = sb->first_data_zone; … … 332 334 const size_t bufsize = MFS_MIN_BLOCKSIZE; 333 335 const long itable_pos = 2 + sb->zbmap_blocks + sb->ibmap_blocks; 336 337 const time_t sec = time(NULL); 334 338 335 339 ino_buf = (struct mfs2_inode *) malloc(bufsize); … … 340 344 ino_buf[MFS_ROOT_INO].i_gid = 0; 341 345 ino_buf[MFS_ROOT_INO].i_size = MFS3_DIRSIZE * 2; 342 ino_buf[MFS_ROOT_INO].i_mtime = 0;343 ino_buf[MFS_ROOT_INO].i_atime = 0;344 ino_buf[MFS_ROOT_INO].i_ctime = 0;346 ino_buf[MFS_ROOT_INO].i_mtime = sec; 347 ino_buf[MFS_ROOT_INO].i_atime = sec; 348 ino_buf[MFS_ROOT_INO].i_ctime = sec; 345 349 ino_buf[MFS_ROOT_INO].i_nlinks = 2; 346 350 ino_buf[MFS_ROOT_INO].i_dzone[0] = sb->first_data_zone;
Note:
See TracChangeset
for help on using the changeset viewer.