[tracker/dbus-fd-experiment: 12/15] Steroids: show error code when read/write fails



commit 31b3aa869e5d2f6ae2569edb1bae8543a92a29d2
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 bdd5f6e..30485a7 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>
 
@@ -144,7 +145,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;
@@ -162,7 +163,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]