summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-20 04:12:15 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-20 04:12:17 +0200
commit0c749d504e98dddde3c39025b03744198a667fcc (patch)
tree1a5586f64755e65aeee9596529f8087186d9a7fd /src
parent38c52d4606c77ff2b2b60a08f663a1983d8254b0 (diff)
nspawn: don't fail when we receive SIGCHLD
https://bugs.freedesktop.org/show_bug.cgi?id=36148
Diffstat (limited to 'src')
-rw-r--r--src/nspawn.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nspawn.c b/src/nspawn.c
index 6b0ba4e57f..969c961895 100644
--- a/src/nspawn.c
+++ b/src/nspawn.c
@@ -374,6 +374,7 @@ static int is_os_tree(const char *path) {
#define BUFFER_SIZE 1024
static int process_pty(int master, sigset_t *mask) {
+
char in_buffer[BUFFER_SIZE], out_buffer[BUFFER_SIZE];
size_t in_buffer_full = 0, out_buffer_full = 0;
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 >= 0) {
+ log_error("Failed to read from signalfd: invalid block size");
r = -EIO;
goto finish;
}
if (errno != EINTR && errno != EAGAIN) {
+ log_error("Failed to read from signalfd: %m");
r = -errno;
goto finish;
}
@@ -481,7 +484,7 @@ static int process_pty(int master, sigset_t *mask) {
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0)
ioctl(master, TIOCSWINSZ, &ws);
} else {
- r = -EINTR;
+ r = 0;
goto finish;
}
}
@@ -501,6 +504,7 @@ static int process_pty(int master, sigset_t *mask) {
stdin_readable = false;
else {
log_error("read(): %m");
+ r = -errno;
goto finish;
}
} else
@@ -515,6 +519,7 @@ static int process_pty(int master, sigset_t *mask) {
master_writable = false;
else {
log_error("write(): %m");
+ r = -errno;
goto finish;
}
@@ -533,6 +538,7 @@ static int process_pty(int master, sigset_t *mask) {
master_readable = false;
else {
log_error("read(): %m");
+ r = -errno;
goto finish;
}
} else
@@ -547,6 +553,7 @@ static int process_pty(int master, sigset_t *mask) {
stdout_writable = false;
else {
log_error("write(): %m");
+ r = -errno;
goto finish;
}