nspawn: don't fail when we receive SIGCHLD

https://bugs.freedesktop.org/show_bug.cgi?id=36148
This commit is contained in:
Lennart Poettering 2011-04-20 04:12:15 +02:00
parent 38c52d4606
commit 0c749d504e
2 changed files with 8 additions and 4 deletions

3
TODO
View File

@ -22,9 +22,6 @@ F15:
* New Avahi package, enable it by default * New Avahi package, enable it by default
* don't trim empty cgroups
https://bugzilla.redhat.com/show_bug.cgi?id=678555
* make anaconda write timeout=0 for encrypted devices * make anaconda write timeout=0 for encrypted devices
* Fix assert http://lists.freedesktop.org/archives/systemd-devel/2011-April/001910.html * Fix assert http://lists.freedesktop.org/archives/systemd-devel/2011-April/001910.html

View File

@ -374,6 +374,7 @@ static int is_os_tree(const char *path) {
#define BUFFER_SIZE 1024 #define BUFFER_SIZE 1024
static int process_pty(int master, sigset_t *mask) { static int process_pty(int master, sigset_t *mask) {
char in_buffer[BUFFER_SIZE], out_buffer[BUFFER_SIZE]; char in_buffer[BUFFER_SIZE], out_buffer[BUFFER_SIZE];
size_t in_buffer_full = 0, out_buffer_full = 0; size_t in_buffer_full = 0, out_buffer_full = 0;
struct epoll_event stdin_ev, stdout_ev, master_ev, signal_ev; struct epoll_event stdin_ev, stdout_ev, master_ev, signal_ev;
@ -464,11 +465,13 @@ static int process_pty(int master, sigset_t *mask) {
if ((n = read(signal_fd, &sfsi, sizeof(sfsi))) != sizeof(sfsi)) { if ((n = read(signal_fd, &sfsi, sizeof(sfsi))) != sizeof(sfsi)) {
if (n >= 0) { if (n >= 0) {
log_error("Failed to read from signalfd: invalid block size");
r = -EIO; r = -EIO;
goto finish; goto finish;
} }
if (errno != EINTR && errno != EAGAIN) { if (errno != EINTR && errno != EAGAIN) {
log_error("Failed to read from signalfd: %m");
r = -errno; r = -errno;
goto finish; goto finish;
} }
@ -481,7 +484,7 @@ static int process_pty(int master, sigset_t *mask) {
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0) if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0)
ioctl(master, TIOCSWINSZ, &ws); ioctl(master, TIOCSWINSZ, &ws);
} else { } else {
r = -EINTR; r = 0;
goto finish; goto finish;
} }
} }
@ -501,6 +504,7 @@ static int process_pty(int master, sigset_t *mask) {
stdin_readable = false; stdin_readable = false;
else { else {
log_error("read(): %m"); log_error("read(): %m");
r = -errno;
goto finish; goto finish;
} }
} else } else
@ -515,6 +519,7 @@ static int process_pty(int master, sigset_t *mask) {
master_writable = false; master_writable = false;
else { else {
log_error("write(): %m"); log_error("write(): %m");
r = -errno;
goto finish; goto finish;
} }
@ -533,6 +538,7 @@ static int process_pty(int master, sigset_t *mask) {
master_readable = false; master_readable = false;
else { else {
log_error("read(): %m"); log_error("read(): %m");
r = -errno;
goto finish; goto finish;
} }
} else } else
@ -547,6 +553,7 @@ static int process_pty(int master, sigset_t *mask) {
stdout_writable = false; stdout_writable = false;
else { else {
log_error("write(): %m"); log_error("write(): %m");
r = -errno;
goto finish; goto finish;
} }