Changeset 86364e8 in rtems
- Timestamp:
- 12/05/13 01:52:42 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 607c854
- Parents:
- 2d5c486
- git-author:
- Nick Withers <nick.withers@…> (12/05/13 01:52:42)
- git-committer:
- Gedare Bloom <gedare@…> (12/24/14 03:49:26)
- Location:
- cpukit/libfs/src/rfs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libfs/src/rfs/rtems-rfs-buffer.h
r2d5c486 r86364e8 69 69 uint32_t references; 70 70 } rtems_rfs_buffer; 71 #define rtems_rfs_buffer_io_request rtems_rfs_buffer_dev ceio_request72 #define rtems_rfs_buffer_io_release rtems_rfs_ uffer_deviceio_release71 #define rtems_rfs_buffer_io_request rtems_rfs_buffer_deviceio_request 72 #define rtems_rfs_buffer_io_release rtems_rfs_buffer_deviceio_release 73 73 74 74 /** -
cpukit/libfs/src/rfs/rtems-rfs-file-system.c
r2d5c486 r86364e8 302 302 } 303 303 304 errno = 0;305 304 return 0; 306 305 } -
cpukit/libfs/src/rfs/rtems-rfs-file-system.h
r2d5c486 r86364e8 390 390 * 391 391 * @retval 0 Successful operation. 392 * @retval error_code An error occurred.392 * @retval -1 Error. See errno 393 393 */ 394 394 int rtems_rfs_fs_open (const char* name, … … 404 404 * 405 405 * @retval 0 Successful operation. 406 * @retval error_code An error occurred.406 * @retval -1 Error. See errno 407 407 */ 408 408 int rtems_rfs_fs_close (rtems_rfs_file_system* fs); -
cpukit/libfs/src/rfs/rtems-rfs-format.c
r2d5c486 r86364e8 468 468 RTEMS_RFS_FS_FORCE_OPEN | RTEMS_RFS_FS_NO_LOCAL_CACHE, 469 469 0, &fs); 470 if (rc < 0) 471 { 470 if (rc != 0) 471 { 472 rc = errno; 473 472 474 printf ("rtems-rfs: format: file system open failed: %d: %s\n", 473 errno, strerror (errno)); 474 return -1; 475 rc, strerror (rc)); 476 477 return rc; 475 478 } 476 479 477 480 rc = rtems_rfs_inode_alloc (fs, RTEMS_RFS_ROOT_INO, &ino); 478 if (rc >0)481 if (rc != 0) 479 482 { 480 483 printf ("rtems-rfs: format: inode allocation failed: %d: %s\n", … … 488 491 printf ("rtems-rfs: format: allocated inode not root ino: %" PRId32 "\n", ino); 489 492 rtems_rfs_fs_close (fs); 490 return rc;493 return EINVAL; 491 494 } 492 495 493 496 rc = rtems_rfs_inode_open (fs, ino, &inode, true); 494 if (rc >0)497 if (rc != 0) 495 498 { 496 499 printf ("rtems-rfs: format: inode open failed: %d: %s\n", … … 505 508 RTEMS_RFS_S_IXGRP | RTEMS_RFS_S_IXOTH), 506 509 0, 0); 507 if (rc >0)510 if (rc != 0) 508 511 printf ("rtems-rfs: format: inode initialise failed: %d: %s\n", 509 512 rc, strerror (rc)); 510 513 511 514 rc = rtems_rfs_dir_add_entry (fs, &inode, ".", 1, ino); 512 if (rc >0)515 if (rc != 0) 513 516 printf ("rtems-rfs: format: directory add failed: %d: %s\n", 514 517 rc, strerror (rc)); 515 518 516 519 rc = rtems_rfs_inode_close (fs, &inode); 517 if (rc >0)520 if (rc != 0) 518 521 printf ("rtems-rfs: format: inode close failed: %d: %s\n", 519 522 rc, strerror (rc)); 520 523 521 524 rc = rtems_rfs_fs_close (fs); 522 if (rc < 0) 525 if (rc != 0) 526 { 527 rc = errno; 528 523 529 printf ("rtems-rfs: format: file system close failed: %d: %s\n", 524 errno, strerror (errno)); 525 526 return rc; 530 rc, strerror (rc)); 531 532 return rc; 533 } 534 535 return 0; 527 536 } 528 537 … … 555 564 */ 556 565 rc = rtems_rfs_buffer_open (name, &fs); 557 if (rc >0)566 if (rc != 0) 558 567 { 559 568 printf ("rtems-rfs: format: buffer open failed: %d: %s\n", 560 569 rc, strerror (rc)); 570 571 errno = rc; 561 572 return -1; 562 573 } … … 569 580 printf ("rtems-rfs: media block is invalid: %" PRIu32 "\n", 570 581 rtems_rfs_fs_media_block_size (&fs)); 582 583 errno = EINVAL; 571 584 return -1; 572 585 } … … 576 589 */ 577 590 if (!rtems_rfs_check_config (&fs, config)) 591 { 592 errno = EINVAL; 578 593 return -1; 594 } 579 595 580 596 if (config->verbose) … … 605 621 606 622 rc = rtems_rfs_buffer_setblksize (&fs, rtems_rfs_fs_block_size (&fs)); 607 if (rc >0)623 if (rc != 0) 608 624 { 609 625 printf ("rtems-rfs: format: setting block size failed: %d: %s\n", 610 626 rc, strerror (rc)); 627 628 errno = rc; 611 629 return -1; 612 630 } … … 615 633 { 616 634 printf ("rtems-rfs: format: superblock write failed\n"); 635 636 errno = EIO; 617 637 return -1; 618 638 } … … 621 641 if (!rtems_rfs_write_group (&fs, group, 622 642 config->initialise_inodes, config->verbose)) 623 return -1; 643 { 644 errno = EIO; 645 return -1; 646 } 624 647 625 648 if (config->verbose) … … 627 650 628 651 rc = rtems_rfs_buffer_close (&fs); 629 if (rc >0)652 if (rc != 0) 630 653 { 631 654 printf ("rtems-rfs: format: buffer close failed: %d: %s\n", 632 655 rc, strerror (rc)); 656 657 errno = rc; 633 658 return -1; 634 659 } 635 660 636 661 rc = rtems_rfs_write_root_dir (name); 637 if (rc >0)662 if (rc != 0) 638 663 { 639 664 printf ("rtems-rfs: format: writing root dir failed: %d: %s\n", 640 665 rc, strerror (rc)); 666 667 errno = rc; 641 668 return -1; 642 669 }
Note: See TracChangeset
for help on using the changeset viewer.