IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 12, 2005, 9:34:34 AM (21 years ago)
Author:
eugene
Message:

pcontrol dev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/host.c

    r3189 r3203  
    33int host (int argc, char **argv) {
    44
    5   int pid, status;
     5  int N, Delete, Off, On;
     6  Host *host;
    67
    7   /* this section needs some help: find the specified host in the queues */
     8  /* this section needs some help: find the specified host in the stacks */
    89  Delete = FALSE;
    910  if ((N = get_argument (argc, argv, "-delete"))) {
     
    1213  }
    1314 
    14   /* this section needs some help: find the specified host in the queues */
     15  /* this section needs some help: find the specified host in the stacks */
    1516  Off = FALSE;
    1617  if ((N = get_argument (argc, argv, "-off"))) {
     
    2930 
    3031  if (Delete) {
    31     host = FindHost (argv[1], PCONTROL_HOST_OFF);
    32     if (host == NULL) {
     32    N = FindNamedHost (argv[1], PCONTROL_HOST_OFF);
     33    if (N < 0) {
    3334      fprintf (stderr, "host %s is not OFF\n", argv[1]);
    3435      return (FALSE);
    3536    }
     37    host = GetHost (PCONTROL_HOST_OFF, N);
    3638    DelHost (host);
    3739    return (TRUE);
     
    4547    }
    4648    host = GetHost (PCONTROL_HOST_OFF, N);
    47     PutHost (host, PCONTROL_HOST_DOWN, QUEUE_BOTTOM);
     49    DownHost (host);
    4850    return (TRUE);
    4951  }
     
    5254    N = FindNamedHost (argv[1], PCONTROL_HOST_IDLE);
    5355    if (N >= 0) {
    54       host = GetHost (PCONTROL_HOST_OFF, N);
    55       PutHost (host, PCONTROL_HOST_OFF, QUEUE_BOTTOM);
     56      host = GetHost (PCONTROL_HOST_IDLE, N);
     57      CLOSE (host[0].stdin);
     58      CLOSE (host[0].stdout);
     59      CLOSE (host[0].stderr);
     60      PutHost (host, PCONTROL_HOST_OFF, STACK_BOTTOM);
    5661      return (TRUE);
    5762    }
    5863    N = FindNamedHost (argv[1], PCONTROL_HOST_DOWN);
    5964    if (N >= 0) {
    60       host = GetHost (PCONTROL_HOST_OFF, N);
    61       PutHost (host, PCONTROL_HOST_OFF, QUEUE_BOTTOM);
     65      host = GetHost (PCONTROL_HOST_DOWN, N);
     66      PutHost (host, PCONTROL_HOST_OFF, STACK_BOTTOM);
    6267      return (TRUE);
    6368    }
    6469    N = FindNamedHost (argv[1], PCONTROL_HOST_BUSY);
    6570    if (N >= 0) {
    66       host = GetHost (PCONTROL_HOST_OFF, N);
    67       PutHost (host, PCONTROL_HOST_OFF, QUEUE_BOTTOM);
     71      host = GetHost (PCONTROL_HOST_BUSY, N);
     72      host[0].markoff  = TRUE;
     73      PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
    6874      return (TRUE);
    6975    }
Note: See TracChangeset for help on using the changeset viewer.