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
|
|
|
*
|
2010-08-16 23:44:46 +05:30
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
2003-10-09 14:05:42 +05:30
|
|
|
*/
|
|
|
|
|
|
|
|
#include "libbb.h"
|
|
|
|
|
2008-06-27 08:22:20 +05:30
|
|
|
ssize_t FAST_FUNC 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;
|
|
|
|
}
|