Changeset: bedca932581a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bedca932581a
Modified Files:
        gdk/gdk_group.c
        gdk/gdk_storage.c
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (42 lines):

diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -69,12 +69,14 @@
                        maxgrps = BATcount(b);                          \
                        if (extents) {                                  \
                                BATsetcount(en, ngrp);                  \
-                               BATextend(en, maxgrps);                 \
+                               if (BATextend(en, maxgrps) != GDK_SUCCEED) \
+                                       goto error;                     \
                                exts = (oid *) Tloc(en, BUNfirst(en));  \
                        }                                               \
                        if (histo) {                                    \
                                BATsetcount(hn, ngrp);                  \
-                               BATextend(hn, maxgrps);                 \
+                               if (BATextend(hn, maxgrps) != GDK_SUCCEED) \
+                                       goto error;                     \
                                cnts = (wrd *) Tloc(hn, BUNfirst(hn));  \
                        }                                               \
                }                                                       \
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -271,7 +271,7 @@ GDKextendf(int fd, size_t size, const ch
        IODEBUG t0 = GDKms();
        if (stb.st_size < (off_t) size) {
 #ifdef HAVE_FALLOCATE
-               if (fallocate(fd, 0, stb.st_size, (off_t) size - stb.st_size) < 
0 &&
+               if ((rt = fallocate(fd, 0, stb.st_size, (off_t) size - 
stb.st_size)) < 0 &&
                    errno == EOPNOTSUPP)
                        /* on Linux, posix_fallocate uses a slow
                         * method to allocate blocks if the underlying
@@ -287,6 +287,9 @@ GDKextendf(int fd, size_t size, const ch
                         * the operation, so just resize the file */
 #endif
 #endif
+               /* we get here when (posix_)fallocate fails because it
+                * is not supported on the file system, or if neither
+                * function exists */
                rt = ftruncate(fd, (off_t) size);
        }
        IODEBUG fprintf(stderr, "#GDKextend %s " SZFMT " -> " SZFMT " %dms%s\n",
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to