Changeset 132ab5d1 in mainline for uspace/srv/bd/file_bd/file_bd.c
- Timestamp:
- 2018-01-30T03:20:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5a6cc679
- Parents:
- 8bfb163 (diff), 6a5d05b (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
-
uspace/srv/bd/file_bd/file_bd.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/file_bd/file_bd.c
r8bfb163 r132ab5d1 48 48 #include <stdint.h> 49 49 #include <errno.h> 50 #include <str_error.h> 50 51 #include <stdbool.h> 51 52 #include <task.h> … … 134 135 rc = loc_service_register(device_name, &service_id); 135 136 if (rc != EOK) { 136 printf("%s: Unable to register device '%s' .\n",137 NAME, device_name );137 printf("%s: Unable to register device '%s': %s.\n", 138 NAME, device_name, str_error(rc)); 138 139 return rc; 139 140 } … … 141 142 rc = loc_category_get_id("disk", &disk_cat, IPC_FLAG_BLOCKING); 142 143 if (rc != EOK) { 143 printf("%s: Failed resolving category 'disk' .\n", NAME);144 printf("%s: Failed resolving category 'disk': %s\n", NAME, str_error(rc)); 144 145 return rc; 145 146 } … … 147 148 rc = loc_service_add_to_cat(service_id, disk_cat); 148 149 if (rc != EOK) { 149 printf("%s: Failed adding %s to category .",150 NAME, device_name );150 printf("%s: Failed adding %s to category: %s", 151 NAME, device_name, str_error(rc)); 151 152 return rc; 152 153 } … … 221 222 { 222 223 size_t n_rd; 223 int rc;224 224 225 225 if (size < cnt * block_size) … … 237 237 238 238 clearerr(img); 239 rc = fseek(img, ba * block_size, SEEK_SET); 240 if (rc < 0) { 239 if (fseek(img, ba * block_size, SEEK_SET) < 0) { 241 240 fibril_mutex_unlock(&dev_lock); 242 241 return EIO; … … 263 262 { 264 263 size_t n_wr; 265 int rc;266 264 267 265 if (size < cnt * block_size) … … 279 277 280 278 clearerr(img); 281 rc = fseek(img, ba * block_size, SEEK_SET); 282 if (rc < 0) { 279 if (fseek(img, ba * block_size, SEEK_SET) < 0) { 283 280 fibril_mutex_unlock(&dev_lock); 284 281 return EIO;
Note:
See TracChangeset
for help on using the changeset viewer.
