|
From: <sv...@va...> - 2009-07-23 10:52:41
|
Author: bart Date: 2009-07-23 11:52:32 +0100 (Thu, 23 Jul 2009) New Revision: 10557 Log: Ported TSAN test 98 to Darwin. Modified: trunk/drd/tests/tsan_unittest.cpp Modified: trunk/drd/tests/tsan_unittest.cpp =================================================================== --- trunk/drd/tests/tsan_unittest.cpp 2009-07-23 10:50:33 UTC (rev 10556) +++ trunk/drd/tests/tsan_unittest.cpp 2009-07-23 10:52:32 UTC (rev 10557) @@ -4773,10 +4773,15 @@ char out_name[100]; // we open two files, on for reading and one for writing, // but the files are actually the same (symlinked). - sprintf(in_name, "/tmp/racecheck_unittest_in.%d", getpid()); sprintf(out_name, "/tmp/racecheck_unittest_out.%d", getpid()); fd_out = creat(out_name, O_WRONLY | S_IRWXU); +#ifdef __APPLE__ + // symlink() is not supported on Darwin. Copy the output file name. + strcpy(in_name, out_name); +#else + sprintf(in_name, "/tmp/racecheck_unittest_in.%d", getpid()); IGNORE_RETURN_VALUE(symlink(out_name, in_name)); +#endif fd_in = open(in_name, 0, O_RDONLY); CHECK(fd_out >= 0); CHECK(fd_in >= 0); |