| | 961 | | | | | 962 | | | | $input_152756 <= ( -8 * bytes_before(&$unknown_779682) - 1 ) / 32 | 963 | | (void)open("/dev/null", O_RDONLY, 0); | Problem | | $input_152756 <= ( -8 * bytes_before(&$unknown_779682) - 1 ) / 32 |
| | $input_152900 <= ( -8 * bytes_before(&$unknown_779790) - 1 ) / 32 | 964 | | (void)open("/dev/null", O_RDONLY, 0); | Problem | | $input_152900 <= ( -8 * bytes_before(&$unknown_779790) - 1 ) / 32 |
| | $input_153044 <= ( -8 * bytes_before(&$unknown_779898) - 1 ) / 32 | 965 | | (void)open("/dev/null", O_RDONLY, 0); | Problem | | $input_153044 <= ( -8 * bytes_before(&$unknown_779898) - 1 ) / 32 |
| | | 966 | | #else | | | 967 | | | | | 968 | | | | | 969 | | | | | 970 | | if (WSAStartup(0x0101, &WSAData) != 0) { | | | 971 | | printf("\nWSAStartup() failed\n"); | | | 972 | | ExitProcess(1); | | | 973 | | } | | | 974 | | setsockopt(INVALID_SOCKET,SOL_SOCKET,SO_OPENTYPE, | | | 975 | | (char *)&nAlert,sizeof(int)); | | | 976 | | osinfo=malloc(sizeof(OSVERSIONINFO)); | | | 977 | | osinfo->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); | | | 978 | | GetVersionEx(osinfo); | | | 979 | | os_is_NT= ( osinfo->dwPlatformId == VER_PLATFORM_WIN32_NT); | | | 980 | | #endif | | | 981 | | | | | 982 | | { | | | 983 | | char *p; | | $input_153188 <= ( -8 * bytes_before(&$unknown_780006) - 1 ) / 32 | 984 | | if (p = getenv("PVMDDEBUG")) | Problem | | $input_153188 <= ( -8 * bytes_before(&$unknown_780006) - 1 ) / 32 |
| | | 985 | | pvmdebmask = pvmstrtoi(p); | | | 986 | | } | | | 987 | | | | | 988 | | #ifndef WIN32 | | $input_153308 <= ( -8 * bytes_before(&$unknown_780096) - 1 ) / 32 | 989 | | if ((pvm_useruid = getuid()) == -1) { | Problem | | $input_153308 <= ( -8 * bytes_before(&$unknown_780096) - 1 ) / 32 |
| | | 990 | | pvmlogerror("main() can't getuid()\n"); | | | 991 | | pvmbailout(0); | | | 992 | | } |
| $input_157724 <= ( -8 * bytes_before(&$unknown_782032) - 1 ) / 32 | 5449 | | | | slave_config(hn, argc, argv) | Problem | | $input_157724 <= ( -8 * bytes_before(&$unknown_782032) - 1 ) / 32 |
| | | 5450 | | | | char *hn; | | | 5451 | | | | int argc; | | | 5452 | | | | char **argv; | | | 5453 | | | | { | | | 5454 | | | | int lh; | | | 5455 | | | | int mh; | | | 5456 | | | | struct hostd *hp; | | | 5457 | | | | int i, j; | | | 5458 | | | | int ac; | | $input_157748 <= ( -8 * bytes_before(&$unknown_782040) - 1 ) / 32 | 5459 | | | | int ms = 0; | Problem | | $input_157748 <= ( -8 * bytes_before(&$unknown_782040) - 1 ) / 32 |
| | | 5460 | | | | #ifndef WIN32 | | $input_157772 <= ( -8 * bytes_before(&$unknown_782048) - 1 ) / 32 | 5461 | | | | int dof = 1; | Problem | | $input_157772 <= ( -8 * bytes_before(&$unknown_782048) - 1 ) / 32 |
| | | 5462 | | | | #else | | | 5463 | | | | int dof = 0; | | | 5464 | | | | #endif | | $input_157796 <= ( -8 * bytes_before(&$unknown_782056) - 1 ) / 32 | 5465 | | | | int bad = 0; | Problem | | $input_157796 <= ( -8 * bytes_before(&$unknown_782056) - 1 ) / 32 |
| | | 5466 | | | | char *p; | | | 5467 | | | | char *s; | | | 5468 | | | | | | $input_157820 <= ( -8 * bytes_before(&$unknown_782064) - 1 ) / 32 | 5469 | | | | for (i = j = ac = 1; i < argc; i++) { | Problem | | $input_157820 <= ( -8 * bytes_before(&$unknown_782064) - 1 ) / 32 |
| | $input_157940 <= ( -8 * bytes_before(((char*)&$heap_255727)[28]) - 1 ) / 32 | 5470 | | | | if (argv[i][0] == '-') { | Problem | | $input_157940 <= ( -8 * bytes_before(((char*)&$heap_255727)[28]) - 1 ) / 32 |
| | $input_157964 <= ( -8 * bytes_before(&$unknown_782100) - 1 ) / 32 | 5471 | | | | switch (argv[i][1]) { | Problem | | $input_157964 <= ( -8 * bytes_before(&$unknown_782100) - 1 ) / 32 |
| | | 5472 | | | | | | | 5473 | | | | case 'S': | | | 5474 | | | | ms = 1; | | | 5475 | | | | break; | | | 5476 | | | | | | | 5477 | | | | case 'f': | | | 5478 | | | | dof = 0; | | | 5479 | | | | break; | | | 5480 | | | | | | $input_157988 <= ( -8 * bytes_before(&$unknown_782106) - 1 ) / 32 | 5481 | | | | default: | Problem | | $input_157988 <= ( -8 * bytes_before(&$unknown_782106) - 1 ) / 32 |
| | $input_158012 <= ( -8 * bytes_before(&$unknown_782112) - 1 ) / 32 | 5482 | | | | pvmlogprintf("slave_config() unknown switch: %s\n", argv[i]); | Problem | | $input_158012 <= ( -8 * bytes_before(&$unknown_782112) - 1 ) / 32 |
| | $input_158084 <= ( -8 * bytes_before(&$unknown_782127) - 1 ) / 32 | 5483 | | | | bad++; | Problem | | $input_158084 <= ( -8 * bytes_before(&$unknown_782127) - 1 ) / 32 |
| | | 5484 | | | | } | | | 5485 | | | | | | | 5486 | | | | } else { | | | 5487 | | | | argv[j++] = argv[i]; | | | 5488 | | | | ac++; | | | 5489 | | | | } | | | 5490 | | | | } | | $input_158180 <= ( -8 * bytes_before(&$unknown_782147) - 1 ) / 32 | 5491 | | | | argc = ac; | Problem | | $input_158180 <= ( -8 * bytes_before(&$unknown_782147) - 1 ) / 32 |
| | | 5492 | | | | | | $input_158204 <= ( -8 * bytes_before(&$unknown_782152) - 1 ) / 32 | 5493 | | | | if (bad || argc != 6) { | Problem | | $input_158204 <= ( -8 * bytes_before(&$unknown_782152) - 1 ) / 32 |
| | | 5494 | | | | pvmlogerror("slave_config: bad args\n"); | | | 5495 | | | | pvmbailout(0); | | | 5496 | | | | } | | | 5497 | | | | | | $input_158252 <= ( -8 * bytes_before(&$unknown_782162) - 1 ) / 32 | 5498 | | | | mh = atoi(argv[1]); | Problem | | $input_158252 <= ( -8 * bytes_before(&$unknown_782162) - 1 ) / 32 |
| | $input_12 <= ( -8 * bytes_before(&$unknown_782176) - 1 ) / 32 | 5499 | | | | lh = atoi(argv[4]); | Problem | | $input_12 <= ( -8 * bytes_before(&$unknown_782176) - 1 ) / 32 |
| | ((char*)&$heap_256336)[20] <= ( -8 * bytes_before(&$unknown_782196) - 1 ) / 32 | 5500 | | | | hosts = ht_new(1); | Problem | | ((char*)&$heap_256336)[20] <= ( -8 * bytes_before(&$unknown_782196) - 1 ) / 32 |
| | $unknown_9999631 <= ( -8 * bytes_before(&$unknown_782219) - 1 ) / 32 | 5501 | | | | hosts->ht_serial = 1; | Problem | | $unknown_9999631 <= ( -8 * bytes_before(&$unknown_782219) - 1 ) / 32 |
| | $unknown_9999669 <= ( -8 * bytes_before(&$unknown_782226) - 1 ) / 32 | 5502 | | | | hosts->ht_master = mh; | Problem | | $unknown_9999669 <= ( -8 * bytes_before(&$unknown_782226) - 1 ) / 32 |
| | $unknown_9999707 <= ( -8 * bytes_before(&$unknown_782233) - 1 ) / 32 | 5503 | | | | hosts->ht_cons = mh; | Problem | | $unknown_9999707 <= ( -8 * bytes_before(&$unknown_782233) - 1 ) / 32 |
| | $unknown_9999745 <= ( -8 * bytes_before(&$unknown_782240) - 1 ) / 32 | 5504 | | | | hosts->ht_local = lh; | Problem | | $unknown_9999745 <= ( -8 * bytes_before(&$unknown_782240) - 1 ) / 32 |
| | | 5505 | | | | | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782247) - 1 ) / 32 | 5506 | | | | hp = hd_new(mh); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782247) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782275) - 1 ) / 32 | 5507 | | | | hp->hd_name = STRALLOC("?"); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782275) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782373) - 1 ) / 32 | 5508 | | | | hex_inadport(argv[2], &hp->hd_sad); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782373) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782394) - 1 ) / 32 | 5509 | | | | hp->hd_mtu = atoi(argv[3]); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782394) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782422) - 1 ) / 32 | 5510 | | | | ht_insert(hosts, hp); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782422) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782439) - 1 ) / 32 | 5511 | | | | hd_unref(hp); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782439) - 1 ) / 32 |
| | | 5512 | | | | | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782449) - 1 ) / 32 | 5513 | | | | hp = hd_new(0); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782449) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782469) - 1 ) / 32 | 5514 | | | | hp->hd_name = STRALLOC("pvmd'"); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782469) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782539) - 1 ) / 32 | 5515 | | | | hp->hd_arch = STRALLOC(myarchname); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782539) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782609) - 1 ) / 32 | 5516 | | | | hp->hd_mtu = pvmudpmtu; | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782609) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782614) - 1 ) / 32 | 5517 | | | | hp->hd_dsig = pvmmydsig; | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782614) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782619) - 1 ) / 32 | 5518 | | | | hex_inadport(argv[5], &hp->hd_sad); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782619) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782634) - 1 ) / 32 | 5519 | | | | ht_insert(hosts, hp); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782634) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782649) - 1 ) / 32 | 5520 | | | | hd_unref(hp); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782649) - 1 ) / 32 |
| | | 5521 | | | | | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782659) - 1 ) / 32 | 5522 | | | | hp = hd_new(lh); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782659) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782679) - 1 ) / 32 | 5523 | | | | hp->hd_name = STRALLOC(hn); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782679) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782749) - 1 ) / 32 | 5524 | | | | hp->hd_arch = STRALLOC(myarchname); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782749) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782819) - 1 ) / 32 | 5525 | | | | hp->hd_mtu = pvmudpmtu; | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782819) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782824) - 1 ) / 32 | 5526 | | | | hp->hd_dsig = pvmmydsig; | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782824) - 1 ) / 32 |
| | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782829) - 1 ) / 32 | 5527 | | | | hex_inadport(argv[5], &hp->hd_sad); | Problem | | hosts->ht_local <= ( -8 * bytes_before(&$unknown_782829) - 1 ) / 32 |
| | | 5528 | | | | ht_insert(hosts, hp); | | | 5529 | | | | hd_unref(hp); | | | 5530 | | | | | | | 5531 | | | | if (i = mksocs()) { | | | 5532 | | | | if (i == 2) { | | | 5533 | | | | printf("PvmDupHost\n"); | | | 5534 | | | | fflush(stdout); | | | 5535 | | | | } | | | 5536 | | | | pvmbailout(0); | | | 5537 | | | | } | | | 5538 | | | | | | | 5539 | | | | printf("ddpro<%d> arch<%s> ip<%s> mtu<%d> dsig<%d>\n", | | | 5540 | | | | DDPROTOCOL,
| | | 5541 | | | | myarchname, | | | 5542 | | | | inadport_hex(&hp->hd_sad), | | | 5543 | | | | pvmudpmtu, | | | 5544 | | | | pvmmydsig); | | | 5545 | | | | fflush(stdout); | | | 5546 | | | | | | | 5547 | | | | #ifndef WIN32 | | | 5548 | | | | | | | 5549 | | | | #if !defined(IMA_OS2) && !defined(CYGWIN) | | | 5550 | | | | if (!ms) | | | 5551 | | | | (void)read(0, (char*)&i, 1); | | | 5552 | | | | #endif | | | 5553 | | | | | | | 5554 | | | | if (dof) { | | | 5555 | | | | if (i = fork()) { | | | 5556 | | | | if (i == -1) | | | 5557 | | | | pvmlogperror("slave_config() fork"); | | | 5558 | | | | exit(0); | | | 5559 | | | | } | | | 5560 | | | | | | | 5561 | | | | | | | 5562 | | | | | | | 5563 | | | | for (i = getdtablesize(); --i >= 0; ) | | | 5564 | | | | | | | 5565 | | | | if (i != netsock && i != loclsock && i != log_fd) | | | 5566 | | | | (void)close(i); | | | 5567 | | | | } | | | 5568 | | | | | | | 5569 | | | | | | | 5570 | | | | | | | 5571 | | | | (void)open("/dev/null", O_RDONLY, 0);
| | | 5572 | | | | (void)open("/dev/null", O_WRONLY, 0);
| | | 5573 | | | | (void)dup2(1, 2); | | | 5574 | | | | | | | 5575 | | | | #endif | | | 5576 | | | | | | | 5577 | | | | pvmsetlog(2); | | | 5578 | | | | | | | 5579 | | | | if ((p = getenv("PVM_PATH"))) | | | 5580 | | | | s = STRALLOC(p);
| | | 5581 | | | | else | | | 5582 | | | | s = STRALLOC(DEFBINDIR);
| | | 5583 | | | | epaths = colonsep(varsub(s)); | | | 5584 | | | | PVM_FREE(s);
| | | 5585 | | | | | | | 5586 | | | | s = STRALLOC(DEFDEBUGGER);
| | | 5587 | | | | debugger = varsub(s); | | | 5588 | | | | PVM_FREE(s);
| | | 5589 | | | | | | | 5590 | | | | if ((s = getenv("PVM_WD"))) | | | 5591 | | | | p = STRALLOC(s);
| | | 5592 | | | | else | | | 5593 | | | | p = STRALLOC(pvmgethome());
| | | 5594 | | | | s = varsub(p); | | | 5595 | | | | if (chdir(s) == -1) | | | 5596 | | | | pvmlogperror(s); | | | 5597 | | | | PVM_FREE(p);
| | | 5598 | | | | PVM_FREE(s);
| | | 5599 | | | | | | | 5600 | | | | runstate = PVMDSTARTUP;
| | | 5601 | | | | | | | 5602 | | | | return 0; | | hosts->ht_local <= ( -8 * bytes_before(hosts->ht_hosts) - 1 ) / 32 | 5603 | | | | } | Problem | | hosts->ht_local <= ( -8 * bytes_before(hosts->ht_hosts) - 1 ) / 32 |
|
| | 1123 | | | | | 1124 | | else | | | 1125 | | master_config(name, argc, argv); | | | 1126 | | | | | 1127 | | #if TTYDIS & 8
| | | 1128 | | setsid(); | | | 1129 | | #endif | | | 1130 | | #if TTYDIS & 4
| | | 1131 | | setpgid(0, 0); | | | 1132 | | #endif | | | 1133 | | #if TTYDIS & 2
| | | 1134 | | setpgrp(0, 0); | | | 1135 | | #endif | | | 1136 | | #if TTYDIS & 1
| | | 1137 | | if ((i = open("/dev/tty", O_RDWR, 0)) != -1) { | | | 1138 | | (void)ioctl(i, TIOCNOTTY, 0); | | | 1139 | | (void)close(i); | | | 1140 | | } | | | 1141 | | #endif | | | 1142 | | | | | 1143 | | myhostpart = hosts->ht_local << (ffs(tidhmask) - 1); | | | 1144 | | pvmmytid = myhostpart | TIDPVMD;
| | | 1145 | | | | | 1146 | | ndead = 1000; | | | 1147 | | | | | 1148 | | | | | 1149 | | | | | 1150 | | deads = TALLOC(ndead, struct deaddata, "dead");
| | | 1151 | | BZERO((char*)deads, ndead * sizeof(struct deaddata));
| | | 1152 | | | | | 1153 | | #ifndef WIN32 | | | 1154 | | | | | 1155 | | | | | 1156 | | #ifndef IMA_I860 | | | 1157 | | #ifdef SYSVSIGNAL | | | 1158 | | #ifndef IMA_BEOSCYLD | | | 1159 | | (void)signal(SIGCLD, reap);
| | | 1160 | | #endif | | | 1161 | | #ifdef IMA_SUNMP | | | 1162 | | sigset(SIGCLD, reap); | | | 1163 | | #endif | | | 1164 | | #else | | | 1165 | | (void)signal(SIGCHLD, reap); | | | 1166 | | #endif | | | 1167 | | #endif | | | 1168 | | | | | 1169 | | #endif | | | 1170 | | | | | 1171 | | if (signal(SIGINT, SIG_IGN) != SIG_IGN)
| | | 1172 | | #ifdef WIN32 | | | 1173 | | (void)signal(SIGINT, (void*) catch); | | | 1174 | | #else | | | 1175 | | (void)signal(SIGINT, catch);
| | | 1176 | | #endif | | | 1177 | | | | | 1178 | | if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
| | | 1179 | | #ifdef WIN32 | | | 1180 | | (void)signal(SIGTERM, (void *) catch); | | | 1181 | | #else | | | 1182 | | (void)signal(SIGTERM, catch);
| | | 1183 | | #endif | | | 1184 | | | | | 1185 | | #ifndef WIN32 | | | 1186 | | (void)signal(SIGHUP, SIG_IGN);
| | | 1187 | | (void)signal(SIGPIPE, SIG_IGN);
| | | 1188 | | #endif | | | 1189 | | | | | 1190 | | #ifndef WIN32 | | | 1191 | | (void)signal(SIGFPE, evilsig);
| | | 1192 | | (void)signal(SIGILL, evilsig);
| | | 1193 | | #else | | | 1194 | | (void)signal(SIGFPE, (void *)evilsig); | | | 1195 | | (void)signal(SIGILL, (void *)evilsig); | | | 1196 | | #endif | | | 1197 | | | | | 1198 | | #ifdef SIGBUS
| | | 1199 | | (void)signal(SIGBUS, evilsig);
| | | 1200 | | #endif | | | 1201 | | | | | 1202 | | #ifndef WIN32 | | | 1203 | | (void)signal(SIGSEGV, evilsig);
| | | 1204 | | #else | | | 1205 | | (void)signal(SIGSEGV, (void *)evilsig); | | | 1206 | | #endif | | | 1207 | | | | | 1208 | | #ifdef SIGSYS
| | | 1209 | | (void)signal(SIGSYS, evilsig);
| | | 1210 | | #endif | | | 1211 | | | | | 1212 | | #ifdef SIGDANGER | | | 1213 | | (void)signal(SIGDANGER, biteme); | | | 1214 | | #endif | | | 1215 | | | | | 1216 | | #ifdef STATISTICS | | | 1217 | | reset_statistics(); | | | 1218 | | #endif | | | 1219 | | | | | 1220 | | task_init(); | | | 1221 | | wait_init(myhostpart, TIDLOCAL);
| | | 1222 | | mb_init(); | | | 1223 | | ppi_init(); | | | 1224 | | | | | 1225 | | opq = pk_new(0); | | | 1226 | | opq->pk_tlink = opq->pk_trlink = opq; | | | 1227 | | | | | 1228 | | | | | 1229 | | | | | 1230 | | if (!slavemode) { | | | 1231 | | printf("%s\n", getenv("PVMSOCK")); | | | 1232 | | fflush(stdout); | | | 1233 | | } | | | 1234 | | | | | 1235 | | | | | 1236 | | | | | 1237 | | if (!slavemode && filehosts) { | | | 1238 | | struct hostd *hp; | | | 1239 | | int hh; | | | 1240 | | int n = 0; | | | 1241 | | | | | 1242 | | for (hh = filehosts->ht_last; hh >= 1; hh--) | | | 1243 | | if ((hp = filehosts->ht_hosts[hh]) && !(hp->hd_flag & HF_NOSTART))
| | | 1244 | | n++; | | | 1245 | | if (n) { | | | 1246 | | addmesg = mesg_new(0); | | | 1247 | | addmesg->m_tag = DM_ADD;
| | | 1248 | | pkint(addmesg, n); | | | 1249 | | for (hh = 1; hh <= filehosts->ht_last; hh++) | | | 1250 | | if ((hp = filehosts->ht_hosts[hh]) && !(hp->hd_flag & HF_NOSTART))
| | | 1251 | | pkstr(addmesg, hp->hd_name); | | | 1252 | | addmesg->m_dst = TIDPVMD;
| | | 1253 | | } | | | 1254 | | } | | | 1255 | | |
|