Changes in / [5fe7692:93ebe4e] in mainline
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
defaults/arm32/gta02/Makefile.config
r5fe7692 r93ebe4e 4 4 # RAM disk format 5 5 RDFMT = tmpfs 6 7 # Support for userspace debuggers8 CONFIG_UDEBUG = n9 10 # Compile kernel tests11 CONFIG_TEST = n12 13 # Barebone build with essential binaries only14 CONFIG_BAREBONE = y -
uspace/lib/c/include/adt/int_map.h
r5fe7692 r93ebe4e 246 246 if (item->value) { \ 247 247 if (dtor) \ 248 free(item->value); \248 dtor(item->value); \ 249 249 item->value = NULL; \ 250 250 } \ -
uspace/srv/devman/devman.c
r5fe7692 r93ebe4e 266 266 } 267 267 268 if (read(fd, buf, len) <= 0) { 268 ssize_t read_bytes = safe_read(fd, buf, len); 269 if (read_bytes <= 0) { 269 270 printf(NAME ": unable to read file '%s'.\n", conf_path); 270 271 goto cleanup; 271 272 } 272 buf[ len] = 0;273 buf[read_bytes] = 0; 273 274 274 275 suc = parse_match_ids(buf, ids); … … 1123 1124 fun_node_t *find_fun_node_by_path(dev_tree_t *tree, char *path) 1124 1125 { 1126 assert(path != NULL); 1127 1128 bool is_absolute = path[0] == '/'; 1129 if (!is_absolute) { 1130 return NULL; 1131 } 1132 1125 1133 fibril_rwlock_read_lock(&tree->rwlock); 1126 1134 … … 1132 1140 char *rel_path = path; 1133 1141 char *next_path_elem = NULL; 1134 bool cont = (rel_path[0] == '/');1142 bool cont = true; 1135 1143 1136 1144 while (cont && fun != NULL) { -
uspace/srv/devman/main.c
r5fe7692 r93ebe4e 477 477 dev = fun->dev; 478 478 479 if (fun == NULL && dev == NULL) { 479 /* 480 * For a valid function to connect to we need a device. The root 481 * function, for example, has no device and cannot be connected to. 482 * This means @c dev needs to be valid regardless whether we are 483 * connecting to a device or to a function. 484 */ 485 if (dev == NULL) { 480 486 printf(NAME ": devman_forward error - no device or function with " 481 487 "handle %" PRIun " was found.\n", handle); -
uspace/srv/devman/util.c
r5fe7692 r93ebe4e 111 111 } 112 112 113 ssize_t safe_read(int fd, void *buffer, size_t size) 114 { 115 if (size == 0) { 116 return 0; 117 } 118 119 uint8_t *buf_ptr = (uint8_t *) buffer; 120 121 size_t total_read = 0; 122 while (total_read < size) { 123 ssize_t bytes_read = read(fd, buf_ptr, size - total_read); 124 if (bytes_read < 0) { 125 /* Error. */ 126 return bytes_read; 127 } else if (bytes_read == 0) { 128 /* Possibly end of file. */ 129 break; 130 } else { 131 /* Read at least something. */ 132 buf_ptr += bytes_read; 133 total_read += bytes_read; 134 } 135 } 136 137 return (ssize_t) total_read; 138 } 139 113 140 /** @} 114 141 */ -
uspace/srv/devman/util.h
r5fe7692 r93ebe4e 47 47 extern void replace_char(char *, char, char); 48 48 49 extern ssize_t safe_read(int, void *, size_t); 50 49 51 #endif 50 52
Note:
See TracChangeset
for help on using the changeset viewer.