Skip to content

Commit

Permalink
The checks for whether a file is locked won't compile on windows
Browse files Browse the repository at this point in the history
For now, we can just #ifdef them out and assume it works
  • Loading branch information
Steve Little committed Feb 3, 2017
1 parent a5253b1 commit b20be55
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion util/filelock_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ class LockTest : public testing::Test {
// to open and close the file from a different process
// to avoid either releasing the lock on close, or not
// contending for it when requesting a lock.

#ifdef OS_WIN

// WaitForSingleObject and GetExitCodeProcess can do what waitpid does.
// TODO - implement on Windows
return true;

#else

pid_t pid = fork();
if ( 0 == pid ) {
// child process
Expand Down Expand Up @@ -91,8 +100,10 @@ class LockTest : public testing::Test {
fprintf( stderr, "Fork failed\n" );
return false;
}

return false;

#endif

}

};
Expand Down

0 comments on commit b20be55

Please sign in to comment.