]> andersk Git - svn-all-fast-export.git/blobdiff - src/svn.cpp
Fail if writing to the process fails
[svn-all-fast-export.git] / src / svn.cpp
index a32005a023e2cf1ce4f1e6e0de9ae877b66bc8ac..e6dc519bc19b09fa5e8576b541bc8cc00e21dfd6 100644 (file)
@@ -228,8 +228,14 @@ svn_error_t *QIODevice_write(void *baton, const char *data, apr_size_t *len)
     QIODevice *device = reinterpret_cast<QIODevice *>(baton);
     device->write(data, *len);
 
-    if (device->bytesToWrite() > 16384)
-        device->waitForBytesWritten(0);
+    while (device->bytesToWrite() > 16*1024) {
+        int timeout = device->bytesToWrite() >= 128*1024 ? -1 : 0;
+        if (!device->waitForBytesWritten(timeout)) {
+            qFatal("Failed to write to process: %s", qPrintable(device->errorString()));
+            return svn_error_createf(APR_EOF, SVN_NO_ERROR, "Failed to write to process: %s",
+                                     qPrintable(device->errorString()));
+        }
+    }
     return SVN_NO_ERROR;
 }
 
@@ -512,6 +518,9 @@ int SvnRevision::exportDispatch(const char *key, const svn_fs_path_change_t *cha
     case Rules::Match::Export:
         return exportInternal(key, change, path_from, rev_from, current, rule);
     }
+
+    // never reached
+    return EXIT_FAILURE;
 }
 
 int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *change,
This page took 0.028054 seconds and 4 git commands to generate.