delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/12/12:06:31

Message-Id: <199901121502.PAA67420@out2.ibm.net>
From: "Mark E." <snowball3 AT usa DOT net>
To: autoconf AT gnu DOT org
Date: Tue, 12 Jan 1999 10:02:59 -0500
MIME-Version: 1.0
Subject: patch for autoheader.sh
CC: djgpp-workers AT delorie DOT com
X-mailer: Pegasus Mail for Win32 (v3.01d)
Reply-To: djgpp-workers AT delorie DOT com

The patch below solves a problem that occurs when autoheader is 
used under Windows in this segment of code:

if test $# -eq 0; then
  if test $status -eq 0; then
    if test -f ${config_h_in} && cmp -s $tmpout 
${config_h_in}; then
      rm -f $tmpout # File didn't change, so 
don't update its mod time.
    else
      mv -f $tmpout ${config_h_in}
    fi
  else
    rm -f $tmpout
  fi
fi

In this segment, autoheader is calling another 
program to modify $tmpout while $tmpout is 
still open for writing. This results in a 
access/sharing violation when executed in 
Windows. The patch below forces $tmpout to 
close before it's mod time is changed. If at 
all possible, please accept the patch.

Thanks to Andris Pavenis for diagnosing the 
problem and finding a workaround.

*** autoheader.sh.bak	Tue Jan  5 08:28:38 1999
--- autoheader.sh	Tue Jan 12 09:39:22 1999
***************
*** 265,270 ****
--- 265,272 ----
  fi
  
  if test $# -eq 0; then
+ # Force $tmpout to close to avoid file sharing problems under 
Windows
+   exec > con
    if test $status -eq 0; then
      if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then
        rm -f $tmpout # File didn't change, so don't update its mod time.

--- 
Mark Elbrecht snowball3 AT usa DOT net
http://members.xoom.com/snowball3/

- Raw text -


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