[hackers] [ubase] Re-order some code in dd(1) || sin

From: <git_AT_suckless.org>
Date: Wed, 11 Jun 2014 14:05:16 +0200

commit d2c215f9ab0878ecaae4362d83dec9ef257a16c4
Author: sin <sin_AT_2f30.org>
Date: Wed Jun 11 12:59:51 2014 +0100

    Re-order some code in dd(1)

diff --git a/dd.c b/dd.c
index 47c2e2d..25bce65 100644
--- a/dd.c
+++ b/dd.c
_AT_@ -158,8 +158,6 @@ copy_splice(struct dd_config *ddc)
 #endif
         n = ddc->bs;
         for (;ddc->b_out != ddc->count && !sigint;) {
- if (n > ddc->count - ddc->b_out)
- n = ddc->count - ddc->b_out;
                 FD_ZERO(&rfd);
                 FD_ZERO(&wfd);
                 FD_SET(ifd, &rfd);
_AT_@ -169,6 +167,8 @@ copy_splice(struct dd_config *ddc)
                         break;
                 }
                 if (FD_ISSET(ifd, &rfd) == 1 && FD_ISSET(ofd, &wfd) == 1) {
+ if (n > ddc->count - ddc->b_out)
+ n = ddc->count - ddc->b_out;
                         r = splice(ifd, NULL, p[1], NULL, n, SPLICE_F_MORE);
                         if (r <= 0) {
                                 ddc->saved_errno = errno;
Received on Wed Jun 11 2014 - 14:05:16 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 11 2014 - 14:12:08 CEST