2003-10-09 14:05:42 +05:30
|
|
|
/* vi: set sw=4 ts=4: */
|
|
|
|
/*
|
|
|
|
* Utility routines.
|
|
|
|
*
|
2004-03-15 13:59:22 +05:30
|
|
|
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
|
2003-10-09 14:05:42 +05:30
|
|
|
*
|
2006-05-20 00:59:19 +05:30
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
2003-10-09 14:05:42 +05:30
|
|
|
*/
|
|
|
|
|
|
|
|
#include "libbb.h"
|
|
|
|
|
2003-10-31 15:01:46 +05:30
|
|
|
ssize_t safe_write(int fd, const void *buf, size_t count)
|
2003-10-09 14:05:42 +05:30
|
|
|
{
|
|
|
|
ssize_t n;
|
|
|
|
|
|
|
|
do {
|
|
|
|
n = write(fd, buf, count);
|
|
|
|
} while (n < 0 && errno == EINTR);
|
|
|
|
|
|
|
|
return n;
|
|
|
|
}
|