aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-10-28 12:02:45 +0100
committerLukas Larsson <[email protected]>2014-10-28 12:02:45 +0100
commit9e9d456cc9db4f04b07afe1d149a0065f85409b1 (patch)
treeca724ff87f8dd08c6c5288d04df21e02338232a1
parent3a4433d67cb2f14c5ed69e8eae7b772eebcaa30b (diff)
parentb4f191993631630ee14cd48e0e792bb3dee1ed5c (diff)
downloadotp-9e9d456cc9db4f04b07afe1d149a0065f85409b1.tar.gz
otp-9e9d456cc9db4f04b07afe1d149a0065f85409b1.tar.bz2
otp-9e9d456cc9db4f04b07afe1d149a0065f85409b1.zip
Merge branch 'lukas/erts/win32-read_file_info-links/OTP-12269' into maint
* lukas/erts/win32-read_file_info-links/OTP-12269: erts: Initialize links when reading file info
-rw-r--r--erts/emulator/drivers/win32/win_efile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c
index a321bb9641..7e4043fc1b 100644
--- a/erts/emulator/drivers/win32/win_efile.c
+++ b/erts/emulator/drivers/win32/win_efile.c
@@ -1288,6 +1288,10 @@ do_fileinfo(Efile_call_state* state, Efile_info* pInfo,
{
HANDLE handle; /* Handle returned by CreateFile() */
BY_HANDLE_FILE_INFORMATION fileInfo; /* from CreateFile() */
+
+ /* We initialise nNumberOfLinks as GetFileInformationByHandle
+ does not always initialise this field */
+ fileInfo.nNumberOfLinks = 1;
if (handle = CreateFileW(name, GENERIC_READ, FILE_SHARE_FLAGS, NULL,
OPEN_EXISTING, 0, NULL)) {
GetFileInformationByHandle(handle, &fileInfo);