IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2006, 10:58:49 PM (20 years ago)
Author:
eugene
Message:

major updates to use gprint for buffered / threaded printing

File:
1 edited

Legend:

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

    r4762 r7917  
    77
    88  if (argc < 2) {
    9     fprintf (stderr, "USAGE: job (arg0) (arg1) ... (argN)\n");
    10     fprintf (GetOutfile(), "STATUS %d\n", -2);
     9    gprint (GP_ERR, "USAGE: job (arg0) (arg1) ... (argN)\n");
     10    gprint (GP_LOG, "STATUS %d\n", -2);
    1111    return (FALSE);
    1212  }
    1313 
    1414  if (ChildStatus != PCLIENT_NONE) {
    15     fprintf (stderr, "need to clear existing child\n");
    16     fprintf (GetOutfile(), "STATUS %d\n", -3);
     15    gprint (GP_ERR, "need to clear existing child\n");
     16    gprint (GP_LOG, "STATUS %d\n", -3);
    1717    return (FALSE);
    1818  }
     
    3131  pid = fork ();
    3232  if (!pid) { /* must be child process */
    33     /* fprintf (stderr, "starting child process %s...\n", targv[0]); */
     33    /* gprint (GP_ERR, "starting child process %s...\n", targv[0]); */
    3434
    3535    /* close the other ends of the pipes */
     
    5050    /* exec job */
    5151    status = execvp (targv[0], targv);
    52     fprintf (stderr, "error starting child process: %d\n", status);
     52    gprint (GP_ERR, "error starting child process: %d\n", status);
    5353    exit (1);
    5454  }
     
    7373  ChildPID = pid;
    7474
    75   fprintf (GetOutfile(), "STATUS %d\n", ChildPID);
     75  gprint (GP_LOG, "STATUS %d\n", ChildPID);
    7676  return (TRUE);
    7777
     
    8585  if (child_stderr_fd[1] != 0) close (child_stderr_fd[1]);
    8686
    87   fprintf (GetOutfile(), "STATUS %d\n", -1);
     87  gprint (GP_LOG, "STATUS %d\n", -1);
    8888  return (FALSE);
    8989}
Note: See TracChangeset for help on using the changeset viewer.