Changeset 9fd39d6 in mainline for uspace/app/netstart/netstart.c


Ignore:
Timestamp:
2010-11-07T19:15:39Z (13 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/netstart/netstart.c

    r68f0c3a r9fd39d6  
    4141#include <task.h>
    4242#include <str_error.h>
    43 #include <err.h>
    4443#include <ipc/ipc.h>
    4544#include <ipc/services.h>
     
    5756static bool spawn(const char *desc, const char *path)
    5857{
     58        int rc;
     59
    5960        printf("%s: Spawning %s (%s)\n", NAME, desc, path);
    60        
    61         const char *argv[2];
    62        
    63         argv[0] = path;
    64         argv[1] = NULL;
    65        
    66         int err;
    67         if (task_spawn(path, argv, &err) == 0) {
     61        rc = task_spawnl(NULL, path, path, NULL);
     62        if (rc != EOK) {
    6863                fprintf(stderr, "%s: Error spawning %s (%s)\n", NAME, path,
    69                     str_error(err));
     64                    str_error(rc));
    7065                return false;
    7166        }
     
    7671int main(int argc, char *argv[])
    7772{
    78         ERROR_DECLARE;
     73        int rc;
    7974       
    8075        if (!spawn("networking service", "/srv/net"))
     
    8479       
    8580        int net_phone = connect_to_service(SERVICE_NETWORKING);
    86         if (ERROR_OCCURRED(ipc_call_sync_0_0(net_phone, NET_NET_STARTUP))) {
    87                 fprintf(stderr, "%s: Startup error %d\n", NAME, ERROR_CODE);
    88                 return ERROR_CODE;
     81        rc = ipc_call_sync_0_0(net_phone, NET_NET_STARTUP);
     82        if (rc != EOK) {
     83                fprintf(stderr, "%s: Startup error %d\n", NAME, rc);
     84                return rc;
    8985        }
    9086       
Note: See TracChangeset for help on using the changeset viewer.