aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/win32/win_efile.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-09-22 11:11:40 +0200
committerLukas Larsson <[email protected]>2014-09-22 11:25:20 +0200
commitb4f191993631630ee14cd48e0e792bb3dee1ed5c (patch)
treeb2e4e6c857f74a6ed1fc3603cdc7357a1d9f7c1b /erts/emulator/drivers/win32/win_efile.c
parentdaa9e1a0d97612f6689685e5a597375ceb9e7b81 (diff)
downloadotp-b4f191993631630ee14cd48e0e792bb3dee1ed5c.tar.gz
otp-b4f191993631630ee14cd48e0e792bb3dee1ed5c.tar.bz2
otp-b4f191993631630ee14cd48e0e792bb3dee1ed5c.zip
erts: Initialize links when reading file info
Diffstat (limited to 'erts/emulator/drivers/win32/win_efile.c')
-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);