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


Ignore:
Timestamp:
2010-07-25T10:11:13Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
377cce8
Parents:
24a2517 (diff), a2da43c (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 with mainline.

File:
1 edited

Legend:

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

    r24a2517 rc621f4aa  
    3939#include <fcntl.h>
    4040#include <unistd.h>
    41 #include <string.h>
     41#include <str.h>
    4242#include <stdio.h>
    4343#include <task.h>
     44#include <str_error.h>
     45
     46#define NAME  "redir"
    4447
    4548static void usage(void)
    4649{
    47         printf("Usage: redir [-i <stdin>] [-o <stdout>] [-e <stderr>] -- <cmd> [args ...]\n");
     50        printf("Usage: %s [-i <stdin>] [-o <stdout>] [-e <stderr>] -- <cmd> [args ...]\n",
     51            NAME);
    4852}
    4953
     
    7276static task_id_t spawn(int argc, char *argv[])
    7377{
    74         char **args = (char *) calloc(argc + 1, sizeof(char *));
     78        const char **args = (const char **) calloc(argc + 1, sizeof(char *));
    7579        if (!args) {
    7680                printf("No memory available\n");
     
    8488        args[argc] = NULL;
    8589       
    86         task_id_t id = task_spawn(argv[0], args);
     90        int err;
     91        task_id_t id = task_spawn(argv[0], args, &err);
    8792       
    8893        free(args);
    8994       
    9095        if (id == 0)
    91                 printf("Error spawning %s\n", argv[0]);
     96                printf("%s: Error spawning %s (%s)\n", NAME, argv[0],
     97                    str_error(err));
    9298       
    9399        return id;
Note: See TracChangeset for help on using the changeset viewer.