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/dvo/elixir.c

    r7680 r7917  
    3030 
    3131  if (argc != 2) {
    32     fprintf (stderr, "USAGE: elixir (elixir) [-time] [-live]\n");
     32    gprint (GP_ERR, "USAGE: elixir (elixir) [-time] [-live]\n");
    3333    return (FALSE);
    3434  }
    3535
    3636  if (!VarConfig (argv[1], "%s", ElixirBase)) {
    37     fprintf (stderr, "elixir %s not in config file\n", argv[1]);
     37    gprint (GP_ERR, "elixir %s not in config file\n", argv[1]);
    3838    return (FALSE);
    3939  }
    4040  sprintf (fifo, "%s.msg", ElixirBase);
    4141  if (!VarConfig ("FIFOS", "%s", fifodir)) {
    42     fprintf (stderr, "FIFOS not in config, using local /tmp\n");
     42    gprint (GP_ERR, "FIFOS not in config, using local /tmp\n");
    4343    strcpy (fifodir, "/tmp");
    4444  }
     
    5151
    5252  if (!WriteMsg (fifo, message)) {
    53     fprintf (stderr, "can't access fifo %s\n", fifo);
     53    gprint (GP_ERR, "can't access fifo %s\n", fifo);
    5454    return (FALSE);
    5555  }
    5656
    5757  if (ReadMsg (msgfile, &answer)) {
    58     fprintf (stderr, "%s\n", answer);
     58    gprint (GP_ERR, "%s\n", answer);
    5959  }
    6060  unlink (msgfile);
     
    9696  }
    9797  if (i >= 20) {
    98     fprintf (stderr, "no response\n");
     98    gprint (GP_ERR, "no response\n");
    9999    return (0);
    100100  }
     
    103103  f = fsetlockfile (fifo, 2.0, LCK_XCLD, &state);
    104104  if (f == NULL) {
    105     fprintf (stderr, "message locked (%d)\n", state);
     105    gprint (GP_ERR, "message locked (%d)\n", state);
    106106    return (0);
    107107  }
     
    121121    nbytes = fread (&buffer[Nbytes], 1, 0x1000, f);
    122122    if (nbytes < 0) {
    123       fprintf (stderr, "error in ReadMsg -- got -1 bytes\n");
     123      gprint (GP_ERR, "error in ReadMsg -- got -1 bytes\n");
    124124      return (0);
    125125    }
Note: See TracChangeset for help on using the changeset viewer.