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/pcontrol/rconnect.c

    r4762 r7917  
    3434  pid = fork ();
    3535  if (!pid) { /* must be child process */
    36     if (VerboseMode()) fprintf (stderr, "starting remote connection to %s...", hostname);
     36    if (VerboseMode()) gprint (GP_ERR, "starting remote connection to %s...", hostname);
    3737
    3838    /* close the other ends of the pipes */
     
    5252
    5353    status = execvp (argv[0], argv);
    54     fprintf (stderr, "error starting remote shell process\n");
     54    gprint (GP_ERR, "error starting remote shell process\n");
    5555    exit (1);
    5656  }
     
    8585  if (status == 0) goto connect_error;
    8686  if (status == -1) goto connect_error;
    87   if (VerboseMode()) fprintf (stderr, "%d cycles to connect\n", i);
     87  if (VerboseMode()) gprint (GP_ERR, "%d cycles to connect\n", i);
    8888  FreeIOBuffer (&buffer);
    8989
    90   if (VerboseMode()) fprintf (stderr, "Connected\n");
     90  if (VerboseMode()) gprint (GP_ERR, "Connected\n");
    9191
    9292  stdio[0] = stdin_fd[1];
     
    101101
    102102connect_error:
    103   if (VerboseMode()) fprintf (stderr, "error while connecting\n");
     103  if (VerboseMode()) gprint (GP_ERR, "error while connecting\n");
    104104
    105105  /* avoid blocking on waitpid, test every 100 usec, up to 50 msec */
     
    116116
    117117  if ((result == -1) && (errno != ECHILD)) {
    118     fprintf (stderr, "unexpected error from waitpid (%d): programming error\n", errno);
     118    gprint (GP_ERR, "unexpected error from waitpid (%d): programming error\n", errno);
    119119    exit (1);
    120120  }
    121121  if (result == 0) {
    122     if (VerboseMode()) fprintf (stderr, "child did not exit??");
     122    if (VerboseMode()) gprint (GP_ERR, "child did not exit??");
    123123  }
    124124  if (result > 0) {
    125125    if (result != pid) {
    126       fprintf (stderr, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
     126      gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
    127127      exit (1);
    128128    }
    129129    if (WIFSTOPPED(waitstatus)) {
    130       fprintf (stderr, "waitpid returns 'stopped': programming error\n");
     130      gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
    131131      exit (1);
    132132    }
Note: See TracChangeset for help on using the changeset viewer.