Commit 91b69f13 authored by Andrew Krieger's avatar Andrew Krieger Committed by Facebook Github Bot

Explicitly use CreateFileA in readlink

Summary:
In Unicode enabled projects, this errors because CreateFile aliases
CreateFileW, which takes wchar_t* not char*.

Reviewed By: Orvid, yfeldblum

Differential Revision: D4878424

fbshipit-source-id: b44b369c0533e74163f68d95c2bf353584033731
parent ee080728
......@@ -205,13 +205,14 @@ ssize_t readlink(const char* path, char* buf, size_t buflen) {
return -1;
}
HANDLE h = CreateFile(path,
GENERIC_READ,
FILE_SHARE_READ,
nullptr,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
nullptr);
HANDLE h = CreateFileA(
path,
GENERIC_READ,
FILE_SHARE_READ,
nullptr,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
nullptr);
if (h == INVALID_HANDLE_VALUE) {
return -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment