Changeset 3fb0fec in mainline for uspace/srv
- Timestamp:
- 2011-07-26T18:29:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7eb0fed8
- Parents:
- efcebe1 (diff), aa865ee (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. - Location:
- uspace/srv
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
refcebe1 r3fb0fec 270 270 } 271 271 272 ssize_t read_bytes = safe_read(fd, buf, len);272 ssize_t read_bytes = read_all(fd, buf, len); 273 273 if (read_bytes <= 0) { 274 log_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path); 274 log_msg(LVL_ERROR, "Unable to read file '%s' (%zd).", conf_path, 275 read_bytes); 275 276 goto cleanup; 276 277 } … … 421 422 } 422 423 423 insert_fun_node(tree, fun, clone_string(""), NULL);424 insert_fun_node(tree, fun, str_dup(""), NULL); 424 425 match_id_t *id = create_match_id(); 425 id->id = clone_string("root");426 id->id = str_dup("root"); 426 427 id->score = 100; 427 428 add_match_id(&fun->match_ids, id); -
uspace/srv/devman/util.c
refcebe1 r3fb0fec 91 91 } 92 92 93 char *clone_string(const char *s)94 {95 size_t size = str_size(s) + 1;96 char *str;97 98 str = (char *) malloc(size);99 if (str != NULL)100 str_cpy(str, size, s);101 return str;102 }103 104 93 void replace_char(char *str, char orig, char repl) 105 94 { … … 111 100 } 112 101 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 140 102 /** @} 141 103 */ -
uspace/srv/devman/util.h
refcebe1 r3fb0fec 44 44 extern size_t get_nonspace_len(const char *); 45 45 extern void free_not_null(const void *); 46 extern char *clone_string(const char *);47 46 extern void replace_char(char *, char, char); 48 49 extern ssize_t safe_read(int, void *, size_t);50 47 51 48 #endif -
uspace/srv/loader/Makefile
refcebe1 r3fb0fec 39 39 LINKER_SCRIPT = $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld 40 40 41 EXTRA_CFLAGS = -Iinclude42 43 41 BINARY = loader 44 42 STATIC_ONLY = y … … 46 44 GENERIC_SOURCES = \ 47 45 main.c \ 48 elf_load.c \49 46 interp.s 50 47 -
uspace/srv/loader/main.c
refcebe1 r3fb0fec 59 59 #include <str.h> 60 60 #include <as.h> 61 #include <elf .h>62 #include <elf _load.h>61 #include <elf/elf.h> 62 #include <elf/elf_load.h> 63 63 64 64 #ifdef CONFIG_RTLD … … 348 348 349 349 /* Initialize list of loaded modules */ 350 list_initialize(&runtime_env->modules _head);351 list_append(&prog_mod.modules_link, &runtime_env->modules _head);350 list_initialize(&runtime_env->modules); 351 list_append(&prog_mod.modules_link, &runtime_env->modules); 352 352 353 353 /* Pointer to program module. Used as root of the module graph. */
Note:
See TracChangeset
for help on using the changeset viewer.