Changeset 58898d1d in mainline for uspace/srv/devman/match.c
- Timestamp:
- 2017-03-24T20:31:54Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8e9b2534
- Parents:
- c9e3692
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/match.c
rc9e3692 r58898d1d 201 201 int fd; 202 202 size_t len = 0; 203 struct stat st; 203 204 204 205 fd = open(conf_path, O_RDONLY); … … 210 211 opened = true; 211 212 212 len = lseek(fd, 0, SEEK_END); 213 lseek(fd, 0, SEEK_SET); 213 if (fstat(fd, &st) != EOK) { 214 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to fstat %d: %s.", fd, 215 str_error(errno)); 216 goto cleanup; 217 } 218 len = st.size; 214 219 if (len == 0) { 215 220 log_msg(LOG_DEFAULT, LVL_ERROR, "Configuration file '%s' is empty.", … … 225 230 } 226 231 227 ssize_t read_bytes = read(fd, buf, len);232 ssize_t read_bytes = read(fd, (aoff64_t []) {0}, buf, len); 228 233 if (read_bytes <= 0) { 229 234 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%d).", conf_path,
Note:
See TracChangeset
for help on using the changeset viewer.