Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: release-201208…
Fetching contributors…

Cannot retrieve contributors at this time

file 55 lines (49 sloc) 1.917 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
--- bzip2-1.0.5/bzip2.c.orig 2008-11-28 05:47:09.537546000 -0800
+++ bzip2-1.0.5/bzip2.c 2008-11-28 05:50:37.075934000 -0800
@@ -221,6 +221,7 @@
 static void copyFileName ( Char*, Char* );
 static void* myMalloc ( Int32 );
 static void applySavedFileAttrToOutputFile ( IntNative fd );
+static void applySavedTimeInfoToOutputFile ( Char *dstName );
 
 
 
@@ -368,6 +369,7 @@
    if (zStream != stdout) {
       Int32 fd = fileno ( zStream );
       if (fd < 0) goto errhandler_io;
+ applySavedTimeInfoToOutputFile ( outName );
       applySavedFileAttrToOutputFile ( fd );
       ret = fclose ( zStream );
       outputHandleJustInCase = NULL;
@@ -481,17 +483,18 @@
 
    closeok:
    if (ferror(zStream)) goto errhandler_io;
+ ret = fflush ( stream );
+ if (ret != 0) goto errhandler_io;
    if (stream != stdout) {
       Int32 fd = fileno ( stream );
       if (fd < 0) goto errhandler_io;
+ applySavedTimeInfoToOutputFile ( outName );
       applySavedFileAttrToOutputFile ( fd );
    }
    ret = fclose ( zStream );
    if (ret == EOF) goto errhandler_io;
 
    if (ferror(stream)) goto errhandler_io;
- ret = fflush ( stream );
- if (ret != 0) goto errhandler_io;
    if (stream != stdout) {
       ret = fclose ( stream );
       outputHandleJustInCase = NULL;
@@ -1297,7 +1300,6 @@
 
    /*--- If there was an I/O error, we won't get here. ---*/
    if ( srcMode == SM_F2F ) {
- applySavedTimeInfoToOutputFile ( outName );
       deleteOutputOnInterrupt = False;
       if ( !keepInputFiles ) {
          IntNative retVal = remove ( inName );
@@ -1475,7 +1477,6 @@
    /*--- If there was an I/O error, we won't get here. ---*/
    if ( magicNumberOK ) {
       if ( srcMode == SM_F2F ) {
- applySavedTimeInfoToOutputFile ( outName );
          deleteOutputOnInterrupt = False;
          if ( !keepInputFiles ) {
             IntNative retVal = remove ( inName );
Something went wrong with that request. Please try again.