Changeset 3fb0fec in mainline for uspace/srv


Ignore:
Timestamp:
2011-07-26T18:29:44Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge mainline changes.

Location:
uspace/srv
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    refcebe1 r3fb0fec  
    270270        }
    271271       
    272         ssize_t read_bytes = safe_read(fd, buf, len);
     272        ssize_t read_bytes = read_all(fd, buf, len);
    273273        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);
    275276                goto cleanup;
    276277        }
     
    421422        }
    422423       
    423         insert_fun_node(tree, fun, clone_string(""), NULL);
     424        insert_fun_node(tree, fun, str_dup(""), NULL);
    424425        match_id_t *id = create_match_id();
    425         id->id = clone_string("root");
     426        id->id = str_dup("root");
    426427        id->score = 100;
    427428        add_match_id(&fun->match_ids, id);
  • uspace/srv/devman/util.c

    refcebe1 r3fb0fec  
    9191}
    9292
    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 
    10493void replace_char(char *str, char orig, char repl)
    10594{
     
    111100}
    112101
    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 
    140102/** @}
    141103 */
  • uspace/srv/devman/util.h

    refcebe1 r3fb0fec  
    4444extern size_t get_nonspace_len(const char *);
    4545extern void free_not_null(const void *);
    46 extern char *clone_string(const char *);
    4746extern void replace_char(char *, char, char);
    48 
    49 extern ssize_t safe_read(int, void *, size_t);
    5047
    5148#endif
  • uspace/srv/loader/Makefile

    refcebe1 r3fb0fec  
    3939LINKER_SCRIPT = $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld
    4040
    41 EXTRA_CFLAGS = -Iinclude
    42 
    4341BINARY = loader
    4442STATIC_ONLY = y
     
    4644GENERIC_SOURCES = \
    4745        main.c \
    48         elf_load.c \
    4946        interp.s
    5047
  • uspace/srv/loader/main.c

    refcebe1 r3fb0fec  
    5959#include <str.h>
    6060#include <as.h>
    61 #include <elf.h>
    62 #include <elf_load.h>
     61#include <elf/elf.h>
     62#include <elf/elf_load.h>
    6363
    6464#ifdef CONFIG_RTLD
     
    348348
    349349        /* 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);
    352352
    353353        /* Pointer to program module. Used as root of the module graph. */
Note: See TracChangeset for help on using the changeset viewer.