| version 1.12, 2002/02/12 00:34:22 |
version 1.13, 2002/02/12 17:20:16 |
|
|
| * coding start date: 11.11.2000 |
* coding start date: 11.11.2000 |
| * authors: Ondrej Jombik |
* authors: Ondrej Jombik |
| * Lubomir Host |
* Lubomir Host |
| * Martin Karas |
* Martin Karas |
| * Copyright (c) 2000-2002 Platon software development group |
* Copyright (c) 2000-2002 Platon software development group |
| * license: GNU General Public License |
* license: GNU General Public License |
| * |
* |
| * $Id$ |
* $Id$ |
| */ |
*/ |
| |
|
| #ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
| # include "config.h" |
# include "config.h" |
| Line 116 main(argc, argv) |
|
| Line 116 main(argc, argv) |
|
| ptbl = cfglocal_process(argc, argv); |
ptbl = cfglocal_process(argc, argv); |
| |
|
| if (ptbl == NULL) { |
if (ptbl == NULL) { |
| msg_error_print("command line fails, terminating\n"); |
/* msg_error_print("command line fails, terminating\n"); */ |
| return 1; |
return 1; |
| } |
} |
| #if DEBUG |
#if DEBUG |
| Line 174 main(argc, argv) |
|
| Line 174 main(argc, argv) |
|
| |
|
| /* Main loop. */ |
/* Main loop. */ |
| while (1) { |
while (1) { |
| |
register int size; |
| |
|
| do { |
do { |
| |
|
| Line 192 main(argc, argv) |
|
| Line 193 main(argc, argv) |
|
| } |
} |
| } |
} |
| } |
} |
| |
size = proctable_get_size(ptbl); |
| |
if (size < 2) |
| |
break; |
| |
|
| /* Check if processes still running. */ |
/* Check if processes still running. */ |
| pid = proctable_wait(&ptbl); |
pid = proctable_wait(&ptbl); |
| Line 202 main(argc, argv) |
|
| Line 206 main(argc, argv) |
|
| return errno; |
return errno; |
| } |
} |
| |
|
| } while (pid > 1 && proctable_get_size(ptbl) > 1); |
size = proctable_get_size(ptbl); |
| |
|
| |
} while (pid > 1 && size > 1); |
| |
|
| { |
|
| register int size = proctable_get_size(ptbl); |
|
| #if 0 && DEBUG |
#if 0 && DEBUG |
| msg_debug_print("main(): proctable_get_size() = %d\n", size); |
msg_debug_print("main(): proctable_get_size() = %d\n", size); |
| #endif |
#endif |
| if (size < 2) |
if (size < 2 /* and 0 is closed */) |
| break; |
break; |
| } |
|
| |
|
| /* TODO: if closed fd 0, always use timeout */ |
/* TODO: if closed fd 0, always use timeout */ |
| if (pid == 1) { |
if (pid == 1) { |
| tv.tv_sec = 1; |
tv.tv_sec = 0; |
| tv.tv_usec = 1000; |
tv.tv_usec = 1000; |
| } |
} |
| |
|