]> git.tuebingen.mpg.de Git - adu.git/blobdiff - fd.c
manual: Improve documentation of --output.
[adu.git] / fd.c
diff --git a/fd.c b/fd.c
index 9fe88679d2d88855a27a3486d4646bd1632c965f..902e8f1898d29c7ace5a481c4f731ce7134f4433 100644 (file)
--- a/fd.c
+++ b/fd.c
  * \param size The length of \a buf in bytes.
  *
  * This function writes out the given buffer and retries if an interrupt
- * occurred during the write.
+ * occurred during the write. The file descriptor is assumed to be in blocking
+ * mode (i.e., EAGAIN is treated as an error).
  *
  * \return Standard.
  *
  * \sa write(2).
  */
-ssize_t __write(int fd, const void *buf, size_t size)
+static ssize_t __write(int fd, const void *buf, size_t size)
 {
        ssize_t ret;
 
        for (;;) {
                ret = write(fd, buf, size);
-               if ((ret < 0) && (errno == EAGAIN || errno == EINTR))
+               if (ret < 0 && errno == EINTR)
                        continue;
                return ret >= 0? ret : -ERRNO_TO_ERROR(errno);
        }