Changeset 26e7d6d in mainline for uspace/app/bdsh/cmds/modules/bdd/bdd.c
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/bdd/bdd.c
r3842a955 r26e7d6d 39 39 40 40 #include <libblock.h> 41 #include < devmap.h>41 #include <loc.h> 42 42 #include <errno.h> 43 43 #include <assert.h> … … 69 69 unsigned int argc; 70 70 unsigned int i, j; 71 devmap_handle_t handle;71 service_id_t service_id; 72 72 aoff64_t offset; 73 73 uint8_t *blk; … … 96 96 size = 256; 97 97 98 rc = devmap_device_get_handle(argv[1], &handle, 0);98 rc = loc_service_get_id(argv[1], &service_id, 0); 99 99 if (rc != EOK) { 100 100 printf("%s: Error resolving device `%s'.\n", cmdname, argv[1]); … … 102 102 } 103 103 104 rc = block_init(EXCHANGE_SERIALIZE, handle, 2048);104 rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048); 105 105 if (rc != EOK) { 106 106 printf("%s: Error initializing libblock.\n", cmdname); … … 108 108 } 109 109 110 rc = block_get_bsize( handle, &block_size);110 rc = block_get_bsize(service_id, &block_size); 111 111 if (rc != EOK) { 112 112 printf("%s: Error determining device block size.\n", cmdname); … … 117 117 if (blk == NULL) { 118 118 printf("%s: Error allocating memory.\n", cmdname); 119 block_fini( handle);119 block_fini(service_id); 120 120 return CMD_FAILURE; 121 121 } … … 124 124 125 125 while (size > 0) { 126 rc = block_read_direct( handle, ba, 1, blk);126 rc = block_read_direct(service_id, ba, 1, blk); 127 127 if (rc != EOK) { 128 128 printf("%s: Error reading block %" PRIuOFF64 "\n", cmdname, ba); 129 129 free(blk); 130 block_fini( handle);130 block_fini(service_id); 131 131 return CMD_FAILURE; 132 132 } … … 170 170 171 171 free(blk); 172 block_fini( handle);172 block_fini(service_id); 173 173 174 174 return CMD_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.