aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-04-16 21:08:03 +0300
committerEli Zaretskii2013-04-16 21:08:03 +0300
commit2d0d2952da64bae2af67014b22a3b8caa9aef810 (patch)
treed6bbb000fae809b94e6517bc703d088f710f9f3c /src
parentdb1ec5b6dfbd4acf342f730da85648de1276f006 (diff)
downloademacs-2d0d2952da64bae2af67014b22a3b8caa9aef810.tar.gz
emacs-2d0d2952da64bae2af67014b22a3b8caa9aef810.zip
Delete previous emacs.exe before dumping to fix problem with hard links to it.
Diffstat (limited to 'src')
-rw-r--r--src/unexw32.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/unexw32.c b/src/unexw32.c
index e8b553a87d3..a01ac799592 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -159,6 +159,14 @@ open_output_file (file_data *p_file, char *filename, unsigned long size)
159 HANDLE file_mapping; 159 HANDLE file_mapping;
160 void *file_base; 160 void *file_base;
161 161
162 /* We delete any existing FILENAME because loadup.el will create a
163 hard link to it under the name emacs-XX.YY.ZZ.nn.exe. Evidently,
164 overwriting a file on Unix breaks any hard links to it, but that
165 doesn't happen on Windows. If we don't delete the file before
166 creating it, all the emacs-XX.YY.ZZ.nn.exe end up being hard
167 links to the same file, which defeats the purpose of these hard
168 links: being able to run previous builds. */
169 DeleteFile (filename);
162 file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, 170 file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
163 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); 171 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
164 if (file == INVALID_HANDLE_VALUE) 172 if (file == INVALID_HANDLE_VALUE)