aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/win32
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-10-28 12:02:55 +0100
committerLukas Larsson <[email protected]>2014-10-28 12:02:55 +0100
commitb1c1a40410c62273dd00e9ca1e29cf3056d41b67 (patch)
tree594ee0e29b6c1e496691b23dd584986a0768b393 /erts/emulator/drivers/win32
parentd1d6a655545ddf3c088bf06f3f8636a5cf3b9fe2 (diff)
parent9e9d456cc9db4f04b07afe1d149a0065f85409b1 (diff)
downloadotp-b1c1a40410c62273dd00e9ca1e29cf3056d41b67.tar.gz
otp-b1c1a40410c62273dd00e9ca1e29cf3056d41b67.tar.bz2
otp-b1c1a40410c62273dd00e9ca1e29cf3056d41b67.zip
Merge branch 'maint'
* maint: erts: Initialize links when reading file info
Diffstat (limited to 'erts/emulator/drivers/win32')
-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);