Changeset: e93fce25690e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e93fce25690e
Modified Files:
        NT/monetdb_config.h.in
        gdk/gdk_storage.c
Branch: Jan2014
Log Message:

Simplified: on Windows, we can also use ftruncate since we provide it.


diffs (27 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -171,7 +171,7 @@
 
 /* Define to 1 if you have the `ftruncate' function. */
 #define HAVE_FTRUNCATE 1
-#define ftruncate(fd, sz)      (_chsize_s((fd), (__int64) (sz)) == 0 ? 0 : -1)
+#define ftruncate(fd, sz)      (-(_chsize_s((fd), (__int64) (sz)) != 0))
 
 /* Does your compiler support function attributes (__attribute__)? */
 /* #undef HAVE_FUNCTION_ATTRIBUTES */
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -239,11 +239,7 @@ GDKextendf(int fd, size_t size)
        }
        /* if necessary, extend the underlying file */
        if (stb.st_size < (off_t) size) {
-#ifdef WIN32
-               return -(_chsize_s(fd, (__int64) size) != 0);
-#else
                return ftruncate(fd, (off_t) size);
-#endif
        }
        return 0;
 }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to