move patient_write to share.h because it now has multiple users
[ust.git] / ustd / ustd.c
index 7d1eb49cec6de8d51157ca3c377a0d0be8d2318c..4a9a14ecdc8d29a9bd9e3b0f56b64d93ae13e5a1 100644 (file)
@@ -35,6 +35,7 @@
 #include "ustd.h"
 #include "localerr.h"
 #include "ustcomm.h"
+#include "share.h"
 
 /* return value: 0 = subbuffer is finished, it won't produce data anymore
  *               1 = got subbuffer successfully
@@ -198,30 +199,6 @@ end:
        return retval;
 }
 
-/* This write is patient because it restarts if it was incomplete.
- */
-
-ssize_t patient_write(int fd, const void *buf, size_t count)
-{
-       const char *bufc = (const char *) buf;
-       int result;
-
-       for(;;) {
-               result = write(fd, bufc, count);
-               if(result <= 0) {
-                       return result;
-               }
-               count -= result;
-               bufc += result;
-
-               if(count == 0) {
-                       break;
-               }
-       }
-
-       return bufc-(const char *)buf;
-}
-
 void decrement_active_buffers(void *arg)
 {
        pthread_mutex_lock(&active_buffers_mutex);
This page took 0.02243 seconds and 4 git commands to generate.