Added SILC Server library.
[silc.git] / lib / silcutil / silcfileutil.c
index 52112ee3903bac053bcdffd982b34faa6e2ff128..30b2a5e5ce2001df916e0a0ebb7b8f38a309af49 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2002 Pekka Riikonen
+  Copyright (C) 1997 - 2005 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
 */
 /* $Id$ */
 
-#include "silcincludes.h"
+#include "silc.h"
 
 /* Opens a file indicated by the filename `filename' with flags indicated
    by the `flags'. */
 
 int silc_file_open(const char *filename, int flags)
 {
-  int fd = open(filename, flags, 0600);
-  return fd;
+  return silc_file_open_mode(filename, flags, 0600);
 }
 
 /* Opens a file indicated by the filename `filename' with flags indicated
@@ -101,7 +100,7 @@ int silc_file_writefile_mode(const char *filename, const char *buffer,
   flags |= O_BINARY;
 #endif /* O_BINARY */
 
-  if ((fd = open(filename, flags, 0644)) == -1) {
+  if ((fd = open(filename, flags, mode)) == -1) {
     SILC_LOG_ERROR(("Cannot open file %s for writing: %s", filename,
                    strerror(errno)));
     return -1;