/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2016-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return -1;
}
} else {
- DWORD flags = 0
- | (operation & LOCK_NB ? LOCKFILE_FAIL_IMMEDIATELY : 0)
- | (operation & LOCK_EX ? LOCKFILE_EXCLUSIVE_LOCK : 0)
- ;
+ DWORD flags = DWORD(
+ (operation & LOCK_NB ? LOCKFILE_FAIL_IMMEDIATELY : 0) |
+ (operation & LOCK_EX ? LOCKFILE_EXCLUSIVE_LOCK : 0));
OVERLAPPED ov = {};
if (!LockFileEx(h, flags, 0, kMaxDWORD, kMaxDWORD, &ov)) {
return -1;