chunk: Externalize error reporting in chunk_write()

This avoids passing that arbitrary label just for error messages, and gives
greater flexibility in handling errors.
This commit is contained in:
Martin Willi
2014-01-23 15:55:32 +01:00
parent 37374a292a
commit b9ee059ca9
6 changed files with 52 additions and 30 deletions
+3 -2
View File
@@ -90,14 +90,15 @@ void chunk_split(chunk_t chunk, const char *mode, ...);
/**
* Write the binary contents of a chunk_t to a file
*
* If the write fails, errno is set appropriately.
*
* @param chunk contents to write to file
* @param path path where file is written to
* @param label label specifying file type
* @param mask file mode creation mask
* @param force overwrite existing file by force
* @return TRUE if write operation was successful
*/
bool chunk_write(chunk_t chunk, char *path, char *label, mode_t mask, bool force);
bool chunk_write(chunk_t chunk, char *path, mode_t mask, bool force);
/**
* Store data read from FD into a chunk