2008-05-19 13:48:50 +05:30
|
|
|
/* vi: set sw=4 ts=4: */
|
|
|
|
/*
|
|
|
|
* Utility routines.
|
|
|
|
*
|
2008-09-25 17:43:34 +05:30
|
|
|
* Copyright (C) 2008 Bernhard Reutner-Fischer
|
2008-05-19 13:48:50 +05:30
|
|
|
*
|
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "libbb.h"
|
|
|
|
|
|
|
|
/* Open file and write string str to it, close file.
|
|
|
|
* Die on any open or write-error. */
|
2008-06-27 08:22:20 +05:30
|
|
|
void FAST_FUNC xopen_xwrite_close(const char* file, const char* str)
|
2008-05-19 13:48:50 +05:30
|
|
|
{
|
|
|
|
int fd = xopen(file, O_WRONLY);
|
|
|
|
|
|
|
|
xwrite(fd, str, strlen(str));
|
|
|
|
close(fd);
|
|
|
|
}
|