gnome-keyring r1483 - in trunk: . daemon daemon/ui pkcs11/gck



Author: nnielsen
Date: Fri Jan 30 20:26:39 2009
New Revision: 1483
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1483&view=rev

Log:
	* 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.


Modified:
   trunk/ChangeLog
   trunk/daemon/gkr-daemon-io.c
   trunk/daemon/ui/gkr-ask-request.c
   trunk/daemon/ui/gkr-ask-tool.c
   trunk/pkcs11/gck/gck-data-file.c

Modified: trunk/daemon/gkr-daemon-io.c
==============================================================================
--- trunk/daemon/gkr-daemon-io.c	(original)
+++ trunk/daemon/gkr-daemon-io.c	Fri Jan 30 20:26:39 2009
@@ -130,7 +130,7 @@
 		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 @@
 		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, 

Modified: trunk/daemon/ui/gkr-ask-request.c
==============================================================================
--- trunk/daemon/ui/gkr-ask-request.c	(original)
+++ trunk/daemon/ui/gkr-ask-request.c	Fri Jan 30 20:26:39 2009
@@ -514,7 +514,7 @@
 
 		/* 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 @@
 
 		/* 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;

Modified: trunk/daemon/ui/gkr-ask-tool.c
==============================================================================
--- trunk/daemon/ui/gkr-ask-tool.c	(original)
+++ trunk/daemon/ui/gkr-ask-tool.c	Fri Jan 30 20:26:39 2009
@@ -203,7 +203,7 @@
 	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));

Modified: trunk/pkcs11/gck/gck-data-file.c
==============================================================================
--- trunk/pkcs11/gck/gck-data-file.c	(original)
+++ trunk/pkcs11/gck/gck-data-file.c	Fri Jan 30 20:26:39 2009
@@ -137,7 +137,7 @@
 		
 		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 @@
 		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) : "");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]