www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/06/28/10:56:48

Date: Fri, 28 Jun 1996 16:52:44 +0200 (MET DST)
From: MOLNAR Laszlo <s0052mol AT sun10 DOT vsz DOT bme DOT hu>
To: djgpp-workers AT delorie DOT com
Subject: Bug in stubify.c
Message-Id: <Pine.SUN.3.91.960628164149.8227A-100000@sun10>
Mime-Version: 1.0

Hi Workers!

I've found a bug in stubify.c. This caused lost clusters when the 
disk became full (fortunately I noticed it on a ramdisk).
The problem is, that it tries to delete the output file before closing it.
(As the Interrupt List 50 says this is not a problem with dr-dos, or when 
share.exe is loaded.)

Bye, ML

So here is the diff:

-------------------cut----------------cut--------------cut---------------
*** stubify.co  Sun Nov  5 22:32:32 1995
--- stubify.c   Fri Jun 28 01:17:10 1996
***************
*** 155,161 ****
      {
        perror(ofname);
-       unlink(ofilename);
        close(ifile);
        close(ofile);
        exit(1);
      }
--- 155,161 ----
      {
        perror(ofname);
        close(ifile);
        close(ofile);
+       unlink(ofilename);
        exit(1);
      }
***************
*** 163,169 ****
      {
        fprintf(stderr, "%s: disk full\n", ofname);
-       unlink(ofilename);
        close(ifile);
        close(ofile);
        exit(1);
      }
--- 163,169 ----
      {
        fprintf(stderr, "%s: disk full\n", ofname);
        close(ifile);
        close(ofile);
+       unlink(ofilename);
        exit(1);
      }

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019