[maemo-commits] [maemo-commits] r11126 - in projects/connectivity/osso-gwobex/trunk: . debian src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Apr 18 16:09:14 EEST 2007
Author: jh
Date: 2007-04-18 16:09:13 +0300 (Wed, 18 Apr 2007)
New Revision: 11126

Modified:
   projects/connectivity/osso-gwobex/trunk/configure.ac
   projects/connectivity/osso-gwobex/trunk/debian/changelog
   projects/connectivity/osso-gwobex/trunk/src/obex-priv.c
Log:
Check the return value of read()

Modified: projects/connectivity/osso-gwobex/trunk/configure.ac
===================================================================
--- projects/connectivity/osso-gwobex/trunk/configure.ac	2007-04-18 12:59:12 UTC (rev 11125)
+++ projects/connectivity/osso-gwobex/trunk/configure.ac	2007-04-18 13:09:13 UTC (rev 11126)
@@ -1,4 +1,4 @@
-AC_INIT([osso-gwobex],[0.54])
+AC_INIT([osso-gwobex],[0.55])
 
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

Modified: projects/connectivity/osso-gwobex/trunk/debian/changelog
===================================================================
--- projects/connectivity/osso-gwobex/trunk/debian/changelog	2007-04-18 12:59:12 UTC (rev 11125)
+++ projects/connectivity/osso-gwobex/trunk/debian/changelog	2007-04-18 13:09:13 UTC (rev 11126)
@@ -1,3 +1,9 @@
+osso-gwobex (0.55) unstable; urgency=low
+
+  * Check the return value of read(). Fixes: MB#1137 
+
+ -- Johan Hedberg <johan.hedberg at nokia.com>  Wed, 18 Apr 2007 15:23:47 +0300
+
 osso-gwobex (0.54) unstable; urgency=low
 
   * Don't set abort error if xfer_close caused the abort itself.

Modified: projects/connectivity/osso-gwobex/trunk/src/obex-priv.c
===================================================================
--- projects/connectivity/osso-gwobex/trunk/src/obex-priv.c	2007-04-18 12:59:12 UTC (rev 11125)
+++ projects/connectivity/osso-gwobex/trunk/src/obex-priv.c	2007-04-18 13:09:13 UTC (rev 11126)
@@ -380,8 +380,21 @@
 
             xfer->do_cb = TRUE;
         }
-        else if (xfer->stream_fd >= 0)
-            (void) write(xfer->stream_fd, buf, actual);
+        else if (xfer->stream_fd >= 0) {
+            int written = 0;
+
+            while (written < actual) {
+                int ret;
+
+                ret = write(xfer->stream_fd, buf, actual);
+                if (ret < 0 && errno != EINTR) {
+                    debug("Could not write: %s (%d)", g_strerror(errno), errno);
+                    break;
+                }
+
+                written += ret;
+            }
+        }
         else {
             xfer->buf = g_realloc(xfer->buf, xfer->counter);
             memcpy(&xfer->buf[xfer->buf_size], buf, actual);


More information about the maemo-commits mailing list