summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Walter <stefw@src.gnome.org>2009-01-30 20:26:39 +0000
committerStefan Walter <stefw@src.gnome.org>2009-01-30 20:26:39 +0000
commit94a6ef3c7f921301cdba847ff6f79835f12384ba (patch)
treeca8b12b7100626283e3206373ae6e956f615d331
parent67dda28a66bb5cbf2f6893d71cdf0dab0a22a7cc (diff)
Fix invalid checks for EINTR and EAGAIN while reading and writing. Fixes
* daemon/gkr-daemon-io.c: * daemon/ui/gkr-ask-request.c: * daemon/ui/gkr-ask-tool.c: * pkcs11/gck/gck-data-file.c: Fix invalid checks for EINTR and EAGAIN while reading and writing. Fixes bug #569786 Spotted by James Henstridge. svn path=/trunk/; revision=1483
-rw-r--r--ChangeLog9
-rw-r--r--daemon/gkr-daemon-io.c4
-rw-r--r--daemon/ui/gkr-ask-request.c4
-rw-r--r--daemon/ui/gkr-ask-tool.c2
-rw-r--r--pkcs11/gck/gck-data-file.c4
5 files changed, 16 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 7bdf0cbe..56f548d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-01-29 Stef Walter <stef@memberwebs.com>
+
+ * daemon/gkr-daemon-io.c:
+ * daemon/ui/gkr-ask-request.c:
+ * daemon/ui/gkr-ask-tool.c:
+ * pkcs11/gck/gck-data-file.c: Fix invalid checks for EINTR
+ and EAGAIN while reading and writing. Fixes bug #569786
+ Caught by James Henstridge
+
2009-01-28 Stef Walter <stef@memberwebs.com>
* gcr/gcr-simple-certificate.c:
diff --git a/daemon/gkr-daemon-io.c b/daemon/gkr-daemon-io.c
index 4c7976ad..78e97be9 100644
--- a/daemon/gkr-daemon-io.c
+++ b/daemon/gkr-daemon-io.c
@@ -130,7 +130,7 @@ yield_and_read_all (int fd, guchar *buf, int len)
gkr_async_end_concurrent ();
if (res <= 0) {
- if (errno == EAGAIN && errno == EINTR)
+ if (errno == EAGAIN || errno == EINTR)
continue;
g_warning ("couldn't read %u bytes from client: %s", all,
@@ -165,7 +165,7 @@ yield_and_write_all (int fd, const guchar *buf, int len)
gkr_async_end_concurrent ();
if (res <= 0) {
- if (errno == EAGAIN && errno == EINTR)
+ if (errno == EAGAIN || errno == EINTR)
continue;
g_warning ("couldn't write %u bytes to client: %s", all,
diff --git a/daemon/ui/gkr-ask-request.c b/daemon/ui/gkr-ask-request.c
index 0a499b18..7343985d 100644
--- a/daemon/ui/gkr-ask-request.c
+++ b/daemon/ui/gkr-ask-request.c
@@ -514,7 +514,7 @@ read_until_end (GkrAskRequest *ask)
/* Got an error */
if (res < 0) {
- if (errno == EINTR && errno == EAGAIN)
+ if (errno == EINTR || errno == EAGAIN)
continue;
g_warning ("couldn't read from ask tool: %s", g_strerror (errno));
break;
@@ -609,7 +609,7 @@ send_all_data (GkrAskRequest *ask, const gchar *buf, gsize len)
/* Got an error */
if (res < 0) {
- if (errno == EINTR && errno == EAGAIN)
+ if (errno == EINTR || errno == EAGAIN)
continue;
g_warning ("couldn't write data to ask tool: %s", g_strerror (errno));
break;
diff --git a/daemon/ui/gkr-ask-tool.c b/daemon/ui/gkr-ask-tool.c
index 0a001229..0d18145f 100644
--- a/daemon/ui/gkr-ask-tool.c
+++ b/daemon/ui/gkr-ask-tool.c
@@ -203,7 +203,7 @@ write_output (const gchar *data, gsize len)
while (len > 0) {
res = write (1, data, len);
if (res <= 0) {
- if (errno == EAGAIN && errno == EINTR)
+ if (errno == EAGAIN || errno == EINTR)
continue;
g_warning ("couldn't write dialog response to output: %s",
g_strerror (errno));
diff --git a/pkcs11/gck/gck-data-file.c b/pkcs11/gck/gck-data-file.c
index 5616fd0d..8cef5f5f 100644
--- a/pkcs11/gck/gck-data-file.c
+++ b/pkcs11/gck/gck-data-file.c
@@ -137,7 +137,7 @@ read_all_bytes (int fd, guchar *buf, gsize len)
res = read (fd, buf, len);
if (res <= 0) {
- if (errno == EAGAIN && errno == EINTR)
+ if (errno == EAGAIN || errno == EINTR)
continue;
if (res < 0 || len != all)
g_warning ("couldn't read %u bytes from store file: %s",
@@ -163,7 +163,7 @@ write_all_bytes (int fd, const guchar *buf, gsize len)
res = write (fd, buf, len);
if (res <= 0) {
- if (errno == EAGAIN && errno == EINTR)
+ if (errno == EAGAIN || errno == EINTR)
continue;
g_warning ("couldn't write %u bytes to store file: %s",
(guint)all, res < 0 ? g_strerror (errno) : "");