IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2005, 6:01:28 AM (21 years ago)
Author:
eugene
Message:

added user scheduler/controller commands, fixed up I/F issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pclient/job.c

    r4450 r4573  
    33int job (int argc, char **argv) {
    44
    5   int pid, status;
     5  int i, pid, status;
     6  char **targv;
    67
    78  if (argc < 2) {
     
    2021  if (pipe (child_stdout_fd) < 0) goto pipe_error;
    2122  if (pipe (child_stderr_fd) < 0) goto pipe_error;
     23
     24  /* need to define arg list with NULL termination */
     25  ALLOCATE (targv, char *, argc);
     26  for (i = 1; i < argc; i++) {
     27    targv[i-1] = strcreate (argv[i]);
     28  }
     29  targv[i] = 0;
    2230
    2331  pid = fork ();
     
    3947    setvbuf (stdout, (char *) NULL, _IONBF, BUFSIZ);
    4048    setvbuf (stderr, (char *) NULL, _IONBF, BUFSIZ);
    41     /* fprintf (stderr, "child is spawned, executing command\n"); */
    42     /* note that this message comes out on the other side of the stderr pipe */
    4349
    4450    /* exec job */
    45     status = execvp (argv[1], &argv[1]);
     51    status = execvp (targv[0], targv);
    4652    fprintf (stderr, "error starting child process: %d\n", status);
    4753    exit (1);
Note: See TracChangeset for help on using the changeset viewer.