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
|
|
|
*
|
2010-08-16 23:44:46 +05:30
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
2008-05-19 13:48:50 +05:30
|
|
|
*/
|
|
|
|
#include "libbb.h"
|
|
|
|
|
|
|
|
/* Open file and write string str to it, close file.
|
2009-03-09 05:42:37 +05:30
|
|
|
* 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);
|
2009-03-09 05:42:37 +05:30
|
|
|
xwrite_str(fd, str);
|
2008-05-19 13:48:50 +05:30
|
|
|
close(fd);
|
|
|
|
}
|