Changeset 368ee04 in mainline for uspace/drv/bus/isa/isa.c
- Timestamp:
- 2017-04-05T18:10:39Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 93ad8166
- Parents:
- 39f892a9 (diff), 2166728 (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/drv/bus/isa/isa.c
r39f892a9 r368ee04 51 51 #include <malloc.h> 52 52 #include <dirent.h> 53 #include <fcntl.h>54 53 #include <ipc/irc.h> 55 54 #include <ipc/services.h> 56 #include < sys/stat.h>55 #include <vfs/vfs.h> 57 56 #include <irc.h> 58 57 #include <ns.h> … … 254 253 size_t len; 255 254 ssize_t r; 256 257 fd = open(conf_path, O_RDONLY); 255 struct stat st; 256 257 fd = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ); 258 258 if (fd < 0) { 259 259 ddf_msg(LVL_ERROR, "Unable to open %s", conf_path); … … 263 263 opened = true; 264 264 265 len = lseek(fd, 0, SEEK_END); 266 lseek(fd, 0, SEEK_SET); 265 if (vfs_stat(fd, &st) != EOK) { 266 ddf_msg(LVL_ERROR, "Unable to vfs_stat %d", fd); 267 goto cleanup; 268 } 269 270 len = st.size; 267 271 if (len == 0) { 268 272 ddf_msg(LVL_ERROR, "Configuration file '%s' is empty.", … … 277 281 } 278 282 279 r = read(fd, buf, len);283 r = vfs_read(fd, (aoff64_t []) {0}, buf, len); 280 284 if (r < 0) { 281 285 ddf_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path); … … 294 298 295 299 if (opened) 296 close(fd);300 vfs_put(fd); 297 301 298 302 return buf;
Note:
See TracChangeset
for help on using the changeset viewer.