*
* $Id$
* Derived from:
- * $FreeBSD: src/lib/libutil/flopen.c,v 1.6 2007/05/23 10:06:03 des Exp $
+ * $FreeBSD: src/lib/libutil/flopen.c,v 1.7 2007/05/23 12:09:33 des Exp $
*/
#include <sys/file.h>
int
flopen(const char *path, int flags, ...)
{
- int fd, operation, serrno, truncate;
+ int fd, operation, serrno, trunc;
struct stat sb, fsb;
mode_t mode;
if (flags & O_NONBLOCK)
operation |= LOCK_NB;
- truncate = (flags & O_TRUNC);
+ trunc = (flags & O_TRUNC);
flags &= ~O_TRUNC;
for (;;) {
close(fd);
continue;
}
- if (truncate && ftruncate(fd, 0) != 0) {
+ if (trunc && ftruncate(fd, 0) != 0) {
/* can't happen [tm] */
serrno = errno;
close(fd);