libite/copyfile.c
/* Actual copy loop, used by both copyfile() and fcopyfile()
 * breaks loop on error and EOF */
Actual copy loop, used by both copyfile() and fcopyfile()
breaks loop on error and EOF
Actual copy loop used by both copyfile () and fcopyfile () breaks loop on error and EOF
static ssize_t do_copy(int in, int out, size_t num, char *buffer, size_t len)
{
	ssize_t ret = 0, size = 0;
	do {
		size_t count = num > len ? len : num;
		ret = read(in, buffer, count);
		if (ret <= 0) {
			if (ret == -1 && EINTR == errno)
				continue;
			break;
		}
		if (ret > 0)
			size += write(out, buffer, ret);
		num  -= count;
	} while (num > 0);
	return size;
}
static ssize_t do_copy ( int in , int out , size_t num , char * buffer , size_t len ) { ssize_t ret = 0 , size = 0 ; do { size_t count = num > len ? len : num ; ret = read ( in , buffer , count ) ; if ( ret <= 0 ) { if ( ret == -1 && EINTR == errno ) continue ; break ; } if ( ret > 0 ) size += write ( out , buffer , ret ) ; num -= count ; } while ( num > 0 ) ; return size ; }
Actual copy loop, used by both copyfile() and fcopyfile()
 breaks loop on error and EOF
Actual copy loop used by both copyfile () and fcopyfile () breaks loop on error and EOF