[tracker/dbus-fd-experiment-2: 3/4] Steroids: show error code when read/write fails



commit 1ba8e27733371509359b267b56653dd4ecdcedf2
Author: Adrien Bustany <abustany gnome org>
Date:   Wed Jun 2 13:03:49 2010 -0400

    Steroids: show error code when read/write fails

 src/tracker-store/tracker-steroids.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-store/tracker-steroids.c b/src/tracker-store/tracker-steroids.c
index 5cda6cf..56854be 100644
--- a/src/tracker-store/tracker-steroids.c
+++ b/src/tracker-store/tracker-steroids.c
@@ -17,6 +17,7 @@
  * Boston, MA  02110-1301, USA.
  */
 
+#include <errno.h>
 #include <sys/types.h>
 #include <unistd.h>
 
@@ -149,7 +150,7 @@ buffer_send (int fd, char *buf, int size)
 		                     size - sent);
 
 		if (ret == -1) {
-			g_critical ("Could not send buffer");
+			g_critical ("Could not send buffer (error code %d)", errno);
 		}
 
 		sent += ret;
@@ -167,7 +168,7 @@ buffer_read (int fd, char *buf, int size)
 		                    size - received);
 
 		if (ret == -1) {
-			g_critical ("Could not read buffer");
+			g_critical ("Could not read buffer (error code %d)", errno);
 		}
 
 		received += ret;



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