diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-12-08 18:45:02 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-12-08 18:45:02 +0200 |
commit | 479a079e6d0ec3f25e4ca0b6ae12eb95dbe63950 (patch) | |
tree | 97c378f3b78509b330b4a563c74462954f3d7b41 | |
parent | c66a3e177070ca4fd301a7ad3f266cf137b82904 (diff) | |
download | lightdm-git-479a079e6d0ec3f25e4ca0b6ae12eb95dbe63950.tar.gz |
Retry read call in session.c if it fails with EINTR.
-rw-r--r-- | src/session.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/session.c b/src/session.c index 15598425..2c05114f 100644 --- a/src/session.c +++ b/src/session.c @@ -404,9 +404,14 @@ static ssize_t read_from_child (Session *session, void *buf, size_t count) { ssize_t n_read; - n_read = read (session->priv->from_child_output, buf, count); - if (n_read < 0) - l_warning (session, "Error reading from session: %s", strerror (errno)); + while ((n_read = read (session->priv->from_child_output, buf, count)) < 0) + { + if (errno != EINTR) + { + l_warning (session, "Error reading from session: %s", strerror (errno)); + return n_read; + } + } return n_read; } |