Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0485135 in mainline for uspace/app/redir/redir.c


Ignore:
Timestamp:
2010-11-05T19:53:00Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
0b81cad0
Parents:
a66e2993
Message:

For more convenience, replace task_spawn() with task_spawnv() and task_spawnl().

File:
1 edited

Legend:

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

    ra66e2993 r0485135  
    4343#include <task.h>
    4444#include <str_error.h>
     45#include <errno.h>
    4546
    4647#define NAME  "redir"
     
    7677static task_id_t spawn(int argc, char *argv[])
    7778{
    78         const char **args = (const char **) calloc(argc + 1, sizeof(char *));
     79        const char **args;
     80        task_id_t id;
     81        int rc;
     82
     83        args = (const char **) calloc(argc + 1, sizeof(char *));
    7984        if (!args) {
    8085                printf("No memory available\n");
     
    8893        args[argc] = NULL;
    8994       
    90         int err;
    91         task_id_t id = task_spawn(argv[0], args, &err);
     95        rc = task_spawnv(&id, argv[0], args);
    9296       
    9397        free(args);
    9498       
    95         if (id == 0)
     99        if (rc != EOK) {
    96100                printf("%s: Error spawning %s (%s)\n", NAME, argv[0],
    97                     str_error(err));
     101                    str_error(rc));
     102        }
    98103       
    99104        return id;
Note: See TracChangeset for help on using the changeset viewer.