]> mj.ucw.cz Git - libucw.git/commitdiff
Cannot swap out the source file, because we don't know how to reopen it.
authorMartin Mares <mj@ucw.cz>
Fri, 9 Feb 2007 20:26:31 +0000 (21:26 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 9 Feb 2007 20:26:31 +0000 (21:26 +0100)
lib/sorter/sbuck.c

index 5bc6bbe488dd2a08ddf046efc2cd9f67ec369a83..ff9e9efa47a0fd7753203736689796866c878e0f 100644 (file)
@@ -71,7 +71,7 @@ sbuck_swap_in(struct sort_bucket *b)
       b->fb = bopen(b->filename, O_RDWR, sorter_stream_bufsize);
       if (b->flags & SBF_OPEN_WRITE)
        bseek(b->fb, 0, SEEK_END);
-      bconfig(b->fb, BCONFIG_IS_TEMP_FILE, 1); /* FIXME: Was it always so? */
+      bconfig(b->fb, BCONFIG_IS_TEMP_FILE, 1);
       b->flags &= ~SBF_SWAPPED_OUT;
       SORT_XTRACE(2, "Swapped in %s", b->filename);
     }
@@ -115,7 +115,7 @@ sbuck_write(struct sort_bucket *b)
 void
 sbuck_swap_out(struct sort_bucket *b)
 {
-  if ((b->flags & (SBF_OPEN_READ | SBF_OPEN_WRITE)) && b->fb)
+  if ((b->flags & (SBF_OPEN_READ | SBF_OPEN_WRITE)) && b->fb && !(b->flags & SBF_SOURCE))
     {
       if (b->flags & SBF_OPEN_WRITE)
        b->size = btell(b->fb);