version 1.38, 2011/07/08 23:29:46 |
version 1.39, 2011/08/03 08:48:19 |
|
|
#include <stdarg.h> |
#include <stdarg.h> |
#include <stdbool.h> |
#include <stdbool.h> |
#include <string.h> |
#include <string.h> |
|
#include <termios.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#include "extern.h" |
#include "extern.h" |
|
|
int status, save_errno = errno; |
int status, save_errno = errno; |
|
|
for (;;) { |
for (;;) { |
pid = waitpid(dc, &status, WCONTINUED); |
pid = waitpid(dc, &status, WCONTINUED | WNOHANG); |
if (pid == -1) { |
if (pid == -1) { |
if (errno == EINTR) |
if (errno == EINTR) |
continue; |
continue; |
_exit(0); |
_exit(0); |
} |
} else if (pid == 0) |
|
break; |
if (WIFEXITED(status) || WIFSIGNALED(status)) |
if (WIFEXITED(status) || WIFSIGNALED(status)) |
_exit(0); |
_exit(0); |
else |
else |
|
|
close(p[0]); |
close(p[0]); |
close(p[1]); |
close(p[1]); |
if (interactive) { |
if (interactive) { |
|
gettty(&ttysaved); |
el = el_init("bc", stdin, stderr, stderr); |
el = el_init("bc", stdin, stderr, stderr); |
hist = history_init(); |
hist = history_init(); |
history(hist, &he, H_SETSIZE, 100); |
history(hist, &he, H_SETSIZE, 100); |