Merge branch 'topic/mm-fixes' of git://208.110.73.182/silc into silc.1.1.branch
[silc.git] / lib / silcutil / silcfileutil.c
index c57cc42beb0457ea33b07c1f317a80457e0fb010..02620b04b877ee1a91829b24d3bd2cdf8aa2cb45 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2005 Pekka Riikonen
+  Copyright (C) 1997 - 2007 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
@@ -82,7 +82,9 @@ int silc_file_writefile(const char *filename, const char *buffer,
     return -1;
   }
 
+#ifdef SILC_UNIX
   fsync(fd);
+#endif /* SILC_UNIX */
 
   return silc_file_close(fd);
 }
@@ -112,7 +114,9 @@ int silc_file_writefile_mode(const char *filename, const char *buffer,
     return -1;
   }
 
+#ifdef SILC_UNIX
   fsync(fd);
+#endif /* SILC_UNIX */
 
   return silc_file_close(fd);
 }
@@ -176,11 +180,15 @@ SilcUInt64 silc_file_size(const char *filename)
   int ret;
   struct stat stats;
 
-#ifndef SILC_WIN32
+#ifdef SILC_WIN32
+  ret = stat(filename, &stats);
+#endif /* SILC_WIN32 */
+#ifdef SILC_UNIX
   ret = lstat(filename, &stats);
-#else
+#endif /* SILC_UNIX */
+#ifdef SILC_SYMBIAN
   ret = stat(filename, &stats);
-#endif
+#endif /* SILC_SYMBIAN */
   if (ret < 0)
     return 0;