IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16472


Ignore:
Timestamp:
Feb 13, 2008, 5:53:35 PM (18 years ago)
Author:
eugene
Message:

unique exit codes

Location:
trunk/Ohana/src/opihi
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.data/precess.c

    r7917 r16472  
    3030  if (!done) {
    3131    gprint (GP_ERR, "error finding epoch %s\n", in_epoch);
    32     exit (0);
     32    return FALSE;
    3333  }
    3434 
  • trunk/Ohana/src/opihi/lib.shell/SocketOps.c

    r12332 r16472  
    3636  if (!status) {
    3737    gprint (GP_ERR, "invalid address\n");
    38     exit (2);
     38    exit (4);
    3939  }
    4040# endif
     
    4545  if (InitSocket == -1) {
    4646    perror ("socket: ");
    47     exit (2);
     47    exit (5);
    4848  }
    4949
     
    7272    if (errno == EADDRINUSE) {
    7373        Address[0].sin_port ++;
    74         if (Address[0].sin_port > MY_PORT + 10) exit (2);
     74        if (Address[0].sin_port > MY_PORT + 10) {
     75          fprintf (stderr, "failed to find a usable port\n");
     76          exit (6);
     77        }
    7578        goto retry_server;
    7679    }
    7780    perror ("bind: ");
    78     exit (2);
     81    exit (7);
    7982  }
    8083  /* repeated starts of the server are limited by xinetd or something:
     
    8588  if (status == -1) {
    8689    perror ("listen: ");
    87     exit (2);
     90    exit (8);
    8891  }
    8992  return (InitSocket);
     
    109112  if (BindSocket == -1) {
    110113    perror ("accept: ");
    111     exit (2);
     114    exit (9);
    112115  }
    113116
     
    175178  if (!status) {
    176179    gprint (GP_ERR, "invalid address\n");
    177     exit (2);
     180    exit (10);
    178181  }
    179182
     
    183186  if (InitSocket == -1) {
    184187    perror ("socket: ");
    185     exit (2);
     188    exit (11);
    186189  }
    187190
     
    190193    if (errno == ECONNREFUSED) {
    191194      Address.sin_port ++;
    192       if (Address.sin_port > MY_PORT + 10) exit (2);
     195      if (Address.sin_port > MY_PORT + 10) exit (12);
    193196      goto retry_client;
    194197    }
    195198    perror ("connect: ");
    196     exit (2);
     199    exit (13);
    197200  }
    198201
     
    222225  if (!status) {
    223226    gprint (GP_ERR, "invalid address\n");
    224     exit (2);
     227    exit (14);
    225228  }
    226229
     
    230233  if (InitSocket == -1) {
    231234    perror ("socket: ");
    232     exit (2);
     235    exit (15);
    233236  }
    234237
     
    237240  if (status == -1) {
    238241    perror ("bind: ");
    239     exit (2);
     242    exit (16);
    240243  }
    241244
     
    243246  if (status == -1) {
    244247    perror ("listen: ");
    245     exit (2);
     248    exit (17);
    246249  }
    247250
     
    269272    if (!test) {
    270273      gprint (GP_ERR, "invalid IP address %s\n", string);
    271       exit (2);
     274      exit (18);
    272275    }
    273276    VALID[Nvalid] = ip1 | (ip2 << 8) | (ip3 << 16) | (ip4 << 24);
  • trunk/Ohana/src/opihi/lib.shell/multicommand.c

    r16002 r16472  
    1212    /* check if down? */
    1313    fprintf (stderr, "error: server fd already defined\n");
    14     exit (1);
     14    exit (30);
    1515  }
    1616
     
    1818  if (VarConfig ("PANTASKS_SERVER", "%s", hostname) == NULL) {
    1919    gprint (GP_ERR, "pantasks server host undefined\n");
    20     exit (2);
     20    exit (31);
    2121  }
    2222
     
    7171              case EPIPE:
    7272                gprint (GP_ERR, "server connection has died\n");
    73                 exit (1);
     73                exit (32);
    7474              default:
    7575                gprint (GP_ERR, "server is busy...\n");
     
    8484              case EPIPE:
    8585                gprint (GP_ERR, "server connection has died\n");
    86                 exit (1);
     86                exit (33);
    8787              default:
    8888                gprint (GP_ERR, "server is busy...\n");
     
    9999              case EPIPE:
    100100                gprint (GP_ERR, "server connection has died\n");
    101                 exit (1);
     101                exit (34);
    102102              default:
    103103                gprint (GP_ERR, "server is busy...\n");
     
    114114              case EPIPE:
    115115                gprint (GP_ERR, "server connection has died\n");
    116                 exit (1);
     116                exit (35);
    117117              default:
    118118                gprint (GP_ERR, "server is busy...\n");
  • trunk/Ohana/src/opihi/lib.shell/opihi.c

    r14449 r16472  
    1717  Nbad = 0;
    1818  while (1) {  /** must exit with command "exit" or "quit" */
    19     if (Nbad == 10) exit (3);
     19    if (Nbad == 10) exit (20);
    2020
    2121    line = readline (prompt);
     
    2626      if (ppid == 1) {
    2727        gprint (GP_ERR, "caught parent shutdown\n");
    28         exit (2);
     28        exit (21);
    2929      }
    30       if (!isatty (STDIN_FILENO)) exit (2);
     30      if (!isatty (STDIN_FILENO)) exit (21);
    3131      gprint (GP_LOG, "Use \"quit\" to exit\n");
    3232      Nbad ++;
  • trunk/Ohana/src/opihi/lib.shell/startup.c

    r16446 r16472  
    155155
    156156    /* if this is not an interactive session, exit here */
    157     if (ONLY_INPUT) exit (2);
    158     if (is_script) exit (2);
     157    if (ONLY_INPUT) exit (40);
     158    if (is_script) exit (41);
    159159    return;
    160160}
  • trunk/Ohana/src/opihi/pcontrol/GetJobOutput.c

    r13720 r16472  
    6262
    6363  gprint (GP_ERR, "programming error: should not reach here (GetJobOutput)\n");
    64   pcontrol_exit (1);
     64  pcontrol_exit (50);
    6565}
  • trunk/Ohana/src/opihi/pcontrol/HostOps.c

    r16457 r16472  
    4040  }
    4141  gprint (GP_ERR, "error: unknown host stack : programming error\n");
    42   pcontrol_exit (1);
     42  pcontrol_exit (51);
    4343  return (NULL);
    4444}
     
    5353  }
    5454  gprint (GP_ERR, "error: unknown host stack : programming error\n");
    55   pcontrol_exit (1);
     55  pcontrol_exit (52);
    5656  return (NULL);
    5757}
  • trunk/Ohana/src/opihi/pcontrol/JobOps.c

    r16457 r16472  
    4444  }
    4545  gprint (GP_ERR, "error: unknown host stack : programming error\n");
    46   pcontrol_exit (1);
     46  pcontrol_exit (53);
    4747  return (NULL);
    4848}
     
    5858  }
    5959  gprint (GP_ERR, "error: unknown job stack : programming error\n");
    60   pcontrol_exit (1);
     60  pcontrol_exit (54);
    6161  return (NULL);
    6262}
  • trunk/Ohana/src/opihi/pcontrol/ResetJob.c

    r16459 r16472  
    4343    default:
    4444      gprint (GP_ERR, "unknown status for pclient command: programming error\n"); 
    45       pcontrol_exit (1);
     45      pcontrol_exit (55);
    4646  }
    4747
    4848  gprint (GP_ERR, "programming error in ResetJob (should not reach here)\n");
    4949  FreeIOBuffer (&buffer);
    50   pcontrol_exit (1);
     50  pcontrol_exit (56);
    5151  return (FALSE);
    5252}
  • trunk/Ohana/src/opihi/pcontrol/StopHosts.c

    r16459 r16472  
    9292    default:
    9393      gprint (GP_ERR, "unknown status for pclient command: programming error\n"); 
    94       pcontrol_exit (1);
     94      pcontrol_exit (57);
    9595  }
    9696  HarvestHost (host[0].pid);
     
    140140      if (result != pid) {
    141141        gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
    142         pcontrol_exit (1);
     142        pcontrol_exit (58);
    143143      }
    144144     
     
    151151      if (WIFSTOPPED(waitstatus)) {
    152152        gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
    153         pcontrol_exit (1);
     153        pcontrol_exit (59);
    154154      }
    155155  }
  • trunk/Ohana/src/opihi/pcontrol/rconnect.c

    r13720 r16472  
    5858    status = execvp (argv[0], argv);
    5959    gprint (GP_ERR, "error starting remote shell process\n");
    60     pcontrol_exit (1);
     60    pcontrol_exit (60);
    6161  }
    6262  free (argv);
     
    122122  if ((result == -1) && (errno != ECHILD)) {
    123123    gprint (GP_ERR, "unexpected error from waitpid (%d): programming error\n", errno);
    124     pcontrol_exit (1);
     124    pcontrol_exit (61);
    125125  }
    126126  if (result == 0) {
     
    130130    if (result != pid) {
    131131      gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
    132       pcontrol_exit (1);
     132      pcontrol_exit (62);
    133133    }
    134134    if (WIFSTOPPED(waitstatus)) {
    135135      gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
    136       pcontrol_exit (1);
     136      pcontrol_exit (63);
    137137    }
    138138  }
Note: See TracChangeset for help on using the changeset viewer.