Changes in uspace/srv/devman/match.c [ce04ea44:aed3e6a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/match.c
rce04ea44 raed3e6a 32 32 33 33 #include <errno.h> 34 #include <fcntl.h> 34 35 #include <io/log.h> 35 36 #include <str.h> 36 37 #include <str_error.h> 37 38 #include <sys/types.h> 38 #include < vfs/vfs.h>39 #include <sys/stat.h> 39 40 40 41 #include "devman.h" … … 200 201 int fd; 201 202 size_t len = 0; 202 struct stat st; 203 204 fd = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ); 203 204 fd = open(conf_path, O_RDONLY); 205 205 if (fd < 0) { 206 206 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to open `%s' for reading: %s.", … … 210 210 opened = true; 211 211 212 if (vfs_stat(fd, &st) != EOK) { 213 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to fstat %d: %s.", fd, 214 str_error(errno)); 215 goto cleanup; 216 } 217 len = st.size; 212 len = lseek(fd, 0, SEEK_END); 213 lseek(fd, 0, SEEK_SET); 218 214 if (len == 0) { 219 215 log_msg(LOG_DEFAULT, LVL_ERROR, "Configuration file '%s' is empty.", … … 229 225 } 230 226 231 ssize_t read_bytes = vfs_read(fd, (aoff64_t []) {0}, buf, len);227 ssize_t read_bytes = read(fd, buf, len); 232 228 if (read_bytes <= 0) { 233 229 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%d).", conf_path, … … 243 239 244 240 if (opened) 245 vfs_put(fd);241 close(fd); 246 242 247 243 return suc;
Note:
See TracChangeset
for help on using the changeset viewer.