MCPcopy Index your code
hub / github.com/RsyncProject/rsync / full_write

Function full_write

util1.c:278–295  ·  view source on GitHub ↗

* Write @p len bytes at @p ptr to descriptor @p desc, retrying if * interrupted. * * @retval len upon success * * @retval <0 write's (negative) error code * * Derived from GNU C's cccp.c. */

Source from the content-addressed store, hash-verified

276 * Derived from GNU C's cccp.c.
277 */
278int full_write(int desc, const char *ptr, size_t len)
279{
280 int total_written;
281
282 total_written = 0;
283 while (len > 0) {
284 int written = write(desc, ptr, len);
285 if (written < 0) {
286 if (errno == EINTR)
287 continue;
288 return written;
289 }
290 total_written += written;
291 ptr += written;
292 len -= written;
293 }
294 return total_written;
295}
296
297/**
298 * Read @p len bytes at @p ptr from descriptor @p desc, retrying if

Callers 2

copy_fileFunction · 0.85
generate_and_send_sumsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected