Changeset 16472
- Timestamp:
- Feb 13, 2008, 5:53:35 PM (18 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 11 edited
-
lib.data/precess.c (modified) (1 diff)
-
lib.shell/SocketOps.c (modified) (13 diffs)
-
lib.shell/multicommand.c (modified) (6 diffs)
-
lib.shell/opihi.c (modified) (2 diffs)
-
lib.shell/startup.c (modified) (1 diff)
-
pcontrol/GetJobOutput.c (modified) (1 diff)
-
pcontrol/HostOps.c (modified) (2 diffs)
-
pcontrol/JobOps.c (modified) (2 diffs)
-
pcontrol/ResetJob.c (modified) (1 diff)
-
pcontrol/StopHosts.c (modified) (3 diffs)
-
pcontrol/rconnect.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.data/precess.c
r7917 r16472 30 30 if (!done) { 31 31 gprint (GP_ERR, "error finding epoch %s\n", in_epoch); 32 exit (0);32 return FALSE; 33 33 } 34 34 -
trunk/Ohana/src/opihi/lib.shell/SocketOps.c
r12332 r16472 36 36 if (!status) { 37 37 gprint (GP_ERR, "invalid address\n"); 38 exit ( 2);38 exit (4); 39 39 } 40 40 # endif … … 45 45 if (InitSocket == -1) { 46 46 perror ("socket: "); 47 exit ( 2);47 exit (5); 48 48 } 49 49 … … 72 72 if (errno == EADDRINUSE) { 73 73 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 } 75 78 goto retry_server; 76 79 } 77 80 perror ("bind: "); 78 exit ( 2);81 exit (7); 79 82 } 80 83 /* repeated starts of the server are limited by xinetd or something: … … 85 88 if (status == -1) { 86 89 perror ("listen: "); 87 exit ( 2);90 exit (8); 88 91 } 89 92 return (InitSocket); … … 109 112 if (BindSocket == -1) { 110 113 perror ("accept: "); 111 exit ( 2);114 exit (9); 112 115 } 113 116 … … 175 178 if (!status) { 176 179 gprint (GP_ERR, "invalid address\n"); 177 exit ( 2);180 exit (10); 178 181 } 179 182 … … 183 186 if (InitSocket == -1) { 184 187 perror ("socket: "); 185 exit ( 2);188 exit (11); 186 189 } 187 190 … … 190 193 if (errno == ECONNREFUSED) { 191 194 Address.sin_port ++; 192 if (Address.sin_port > MY_PORT + 10) exit ( 2);195 if (Address.sin_port > MY_PORT + 10) exit (12); 193 196 goto retry_client; 194 197 } 195 198 perror ("connect: "); 196 exit ( 2);199 exit (13); 197 200 } 198 201 … … 222 225 if (!status) { 223 226 gprint (GP_ERR, "invalid address\n"); 224 exit ( 2);227 exit (14); 225 228 } 226 229 … … 230 233 if (InitSocket == -1) { 231 234 perror ("socket: "); 232 exit ( 2);235 exit (15); 233 236 } 234 237 … … 237 240 if (status == -1) { 238 241 perror ("bind: "); 239 exit ( 2);242 exit (16); 240 243 } 241 244 … … 243 246 if (status == -1) { 244 247 perror ("listen: "); 245 exit ( 2);248 exit (17); 246 249 } 247 250 … … 269 272 if (!test) { 270 273 gprint (GP_ERR, "invalid IP address %s\n", string); 271 exit ( 2);274 exit (18); 272 275 } 273 276 VALID[Nvalid] = ip1 | (ip2 << 8) | (ip3 << 16) | (ip4 << 24); -
trunk/Ohana/src/opihi/lib.shell/multicommand.c
r16002 r16472 12 12 /* check if down? */ 13 13 fprintf (stderr, "error: server fd already defined\n"); 14 exit ( 1);14 exit (30); 15 15 } 16 16 … … 18 18 if (VarConfig ("PANTASKS_SERVER", "%s", hostname) == NULL) { 19 19 gprint (GP_ERR, "pantasks server host undefined\n"); 20 exit ( 2);20 exit (31); 21 21 } 22 22 … … 71 71 case EPIPE: 72 72 gprint (GP_ERR, "server connection has died\n"); 73 exit ( 1);73 exit (32); 74 74 default: 75 75 gprint (GP_ERR, "server is busy...\n"); … … 84 84 case EPIPE: 85 85 gprint (GP_ERR, "server connection has died\n"); 86 exit ( 1);86 exit (33); 87 87 default: 88 88 gprint (GP_ERR, "server is busy...\n"); … … 99 99 case EPIPE: 100 100 gprint (GP_ERR, "server connection has died\n"); 101 exit ( 1);101 exit (34); 102 102 default: 103 103 gprint (GP_ERR, "server is busy...\n"); … … 114 114 case EPIPE: 115 115 gprint (GP_ERR, "server connection has died\n"); 116 exit ( 1);116 exit (35); 117 117 default: 118 118 gprint (GP_ERR, "server is busy...\n"); -
trunk/Ohana/src/opihi/lib.shell/opihi.c
r14449 r16472 17 17 Nbad = 0; 18 18 while (1) { /** must exit with command "exit" or "quit" */ 19 if (Nbad == 10) exit ( 3);19 if (Nbad == 10) exit (20); 20 20 21 21 line = readline (prompt); … … 26 26 if (ppid == 1) { 27 27 gprint (GP_ERR, "caught parent shutdown\n"); 28 exit (2 );28 exit (21); 29 29 } 30 if (!isatty (STDIN_FILENO)) exit (2 );30 if (!isatty (STDIN_FILENO)) exit (21); 31 31 gprint (GP_LOG, "Use \"quit\" to exit\n"); 32 32 Nbad ++; -
trunk/Ohana/src/opihi/lib.shell/startup.c
r16446 r16472 155 155 156 156 /* 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); 159 159 return; 160 160 } -
trunk/Ohana/src/opihi/pcontrol/GetJobOutput.c
r13720 r16472 62 62 63 63 gprint (GP_ERR, "programming error: should not reach here (GetJobOutput)\n"); 64 pcontrol_exit ( 1);64 pcontrol_exit (50); 65 65 } -
trunk/Ohana/src/opihi/pcontrol/HostOps.c
r16457 r16472 40 40 } 41 41 gprint (GP_ERR, "error: unknown host stack : programming error\n"); 42 pcontrol_exit ( 1);42 pcontrol_exit (51); 43 43 return (NULL); 44 44 } … … 53 53 } 54 54 gprint (GP_ERR, "error: unknown host stack : programming error\n"); 55 pcontrol_exit ( 1);55 pcontrol_exit (52); 56 56 return (NULL); 57 57 } -
trunk/Ohana/src/opihi/pcontrol/JobOps.c
r16457 r16472 44 44 } 45 45 gprint (GP_ERR, "error: unknown host stack : programming error\n"); 46 pcontrol_exit ( 1);46 pcontrol_exit (53); 47 47 return (NULL); 48 48 } … … 58 58 } 59 59 gprint (GP_ERR, "error: unknown job stack : programming error\n"); 60 pcontrol_exit ( 1);60 pcontrol_exit (54); 61 61 return (NULL); 62 62 } -
trunk/Ohana/src/opihi/pcontrol/ResetJob.c
r16459 r16472 43 43 default: 44 44 gprint (GP_ERR, "unknown status for pclient command: programming error\n"); 45 pcontrol_exit ( 1);45 pcontrol_exit (55); 46 46 } 47 47 48 48 gprint (GP_ERR, "programming error in ResetJob (should not reach here)\n"); 49 49 FreeIOBuffer (&buffer); 50 pcontrol_exit ( 1);50 pcontrol_exit (56); 51 51 return (FALSE); 52 52 } -
trunk/Ohana/src/opihi/pcontrol/StopHosts.c
r16459 r16472 92 92 default: 93 93 gprint (GP_ERR, "unknown status for pclient command: programming error\n"); 94 pcontrol_exit ( 1);94 pcontrol_exit (57); 95 95 } 96 96 HarvestHost (host[0].pid); … … 140 140 if (result != pid) { 141 141 gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d). programming error\n", result, pid); 142 pcontrol_exit ( 1);142 pcontrol_exit (58); 143 143 } 144 144 … … 151 151 if (WIFSTOPPED(waitstatus)) { 152 152 gprint (GP_ERR, "waitpid returns 'stopped': programming error\n"); 153 pcontrol_exit ( 1);153 pcontrol_exit (59); 154 154 } 155 155 } -
trunk/Ohana/src/opihi/pcontrol/rconnect.c
r13720 r16472 58 58 status = execvp (argv[0], argv); 59 59 gprint (GP_ERR, "error starting remote shell process\n"); 60 pcontrol_exit ( 1);60 pcontrol_exit (60); 61 61 } 62 62 free (argv); … … 122 122 if ((result == -1) && (errno != ECHILD)) { 123 123 gprint (GP_ERR, "unexpected error from waitpid (%d): programming error\n", errno); 124 pcontrol_exit ( 1);124 pcontrol_exit (61); 125 125 } 126 126 if (result == 0) { … … 130 130 if (result != pid) { 131 131 gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d). programming error\n", result, pid); 132 pcontrol_exit ( 1);132 pcontrol_exit (62); 133 133 } 134 134 if (WIFSTOPPED(waitstatus)) { 135 135 gprint (GP_ERR, "waitpid returns 'stopped': programming error\n"); 136 pcontrol_exit ( 1);136 pcontrol_exit (63); 137 137 } 138 138 }
Note:
See TracChangeset
for help on using the changeset viewer.
