Changeset 9fd39d6 in mainline for uspace/srv


Ignore:
Timestamp:
2010-11-07T19:15:39Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
16ac756
Parents:
68f0c3a (diff), 3da12d74 (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:
2 edited

Legend:

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

    r68f0c3a r9fd39d6  
    3737#include <ipc/devman.h>
    3838#include <devmap.h>
     39#include <str_error.h>
    3940
    4041#include "devman.h"
     
    446447bool start_driver(driver_t *drv)
    447448{
     449        int rc;
     450
    448451        printf(NAME ": start_driver '%s'\n", drv->name);
    449452       
    450         const char *argv[2];
    451        
    452         argv[0] = drv->name;
    453         argv[1] = NULL;
    454        
    455         int err;
    456         if (task_spawn(drv->binary_path, argv, &err) == 0) {
    457                 printf(NAME ": error spawning %s, errno = %d\n",
    458                     drv->name, err);
     453        rc = task_spawnl(NULL, drv->binary_path, drv->binary_path, NULL);
     454        if (rc != EOK) {
     455                printf(NAME ": error spawning %s (%s)\n",
     456                    drv->name, str_error(rc));
    459457                return false;
    460458        }
  • uspace/srv/taskmon/taskmon.c

    r68f0c3a r9fd39d6  
    5050static void fault_event(ipc_callid_t callid, ipc_call_t *call)
    5151{
    52         const char *argv[6];
    5352        const char *fname;
    54         char *dump_fname;
    5553        char *s_taskid;
    56         const char **s;
     54        int rc;
    5755
    5856        task_id_t taskid;
     
    6765        }
    6866
     67        printf(NAME ": Task %" PRIuTASKID " fault in thread %p.\n", taskid, thread);
     68
     69        fname = "/app/taskdump";
     70
     71#ifdef CONFIG_WRITE_CORE_FILES
     72        char *dump_fname;
     73
    6974        if (asprintf(&dump_fname, "/data/core%" PRIuTASKID, taskid) < 0) {
    7075                printf("Memory allocation failed.\n");
     
    7277        }
    7378
    74         printf(NAME ": Task %" PRIuTASKID " fault in thread %p.\n", taskid, thread);
    75 
    76 #ifdef CONFIG_WRITE_CORE_FILES
    77         argv[0] = "/app/taskdump";
    78         argv[1] = "-c";
    79         argv[2] = dump_fname;
    80         argv[3] = "-t";
    81         argv[4] = s_taskid;
    82         argv[5] = NULL;
     79        printf(NAME ": Executing %s -c %s -t %s\n", dump_fname, s_taskid);
     80        rc = task_spawnl(NULL, fname, fname, "-c", dump_fname, "-t", s_taskid,
     81            NULL);
    8382#else
    84         argv[0] = "/app/taskdump";
    85         argv[1] = "-t";
    86         argv[2] = s_taskid;
    87         argv[3] = NULL;
     83        printf(NAME ": Executing %s -t %s\n", s_taskid);
     84        rc = task_spawnl(NULL, fname, fname, "-t", s_taskid, NULL);
    8885#endif
    89         fname = argv[0];
    90 
    91         printf(NAME ": Executing");
    92        
    93         s = argv;
    94         while (*s != NULL) {
    95                 printf(" %s", *s);
    96                 ++s;
     86        if (rc != EOK) {
     87                printf("%s: Error spawning %s (%s).\n", NAME, fname,
     88                    str_error(rc));
    9789        }
    98         putchar('\n');
    99        
    100         int err;
    101         if (!task_spawn(fname, argv, &err))
    102                 printf("%s: Error spawning %s (%s).\n", NAME, fname,
    103                     str_error(err));
    10490}
    10591
Note: See TracChangeset for help on using the changeset viewer.