{
struct stat status;
- if (silc_unlikely(!filename || !return_stat)) {
+ if (silc_unlikely(!filename)) {
silc_set_errno(SILC_ERR_INVALID_ARGUMENT);
return FALSE;
}
#endif /* HAVE_LSTAT */
}
- silc_file_fill_stat(&status, return_stat);
+ if (return_stat)
+ silc_file_fill_stat(&status, return_stat);
return TRUE;
}
{
struct stat status;
- if (silc_unlikely(!return_stat)) {
- silc_set_errno(SILC_ERR_INVALID_ARGUMENT);
- return FALSE;
- }
-
if (silc_unlikely(fstat(fd, &status) != 0)) {
silc_set_errno_posix(errno);
return FALSE;
}
- silc_file_fill_stat(&status, return_stat);
+ if (return_stat)
+ silc_file_fill_stat(&status, return_stat);
return TRUE;
}
*
* DESCRIPTION
*
- * Writes a buffer to the file. If the file is created specific mode is
- * set to the file.
+ * Writes a buffer to the file. Returns 0 on success and -1 on error.
*
***/
int silc_file_writefile(const char *filename, const char *buffer,
* DESCRIPTION
*
* Writes a buffer to the file. If the file is created the specified `mode'
- * is set to the file.
+ * is set to the file. Returns 0 on success and -1 on error.
*
***/
int silc_file_writefile_mode(const char *filename, const char *buffer,