am a864e72b: Merge "Fix sys_stat.mkfifo when not run as root."
* commit 'a864e72b566234fdc41344725aa9b4f47c5baba3': Fix sys_stat.mkfifo when not run as root.
This commit is contained in:
commit
17c236912b
@ -56,6 +56,7 @@ TEST(sys_stat, futimens_EBADF) {
|
||||
}
|
||||
|
||||
TEST(sys_stat, mkfifo) {
|
||||
if (getuid() == 0) {
|
||||
// Racy but probably sufficient way to get a suitable filename.
|
||||
std::string path;
|
||||
{
|
||||
@ -68,6 +69,9 @@ TEST(sys_stat, mkfifo) {
|
||||
ASSERT_EQ(0, stat(path.c_str(), &sb));
|
||||
ASSERT_TRUE(S_ISFIFO(sb.st_mode));
|
||||
unlink(path.c_str());
|
||||
} else {
|
||||
GTEST_LOG_(INFO) << "This test only performs a test when run as root.";
|
||||
}
|
||||
}
|
||||
|
||||
TEST(sys_stat, stat64_lstat64_fstat64) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user