summaryrefslogtreecommitdiffhomepage
path: root/test/util
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2020-08-31 13:08:49 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-31 13:10:56 -0700
commit9d0d82088a5bd385ceb63cb2f864e054638c69e1 (patch)
tree2930cc32bae81cd85831551bf2a4f2012b64609b /test/util
parent911cecaa34f15d9591fa060d943c35791adca855 (diff)
Remove __fuchsia__ defines
These mostly guard linux-only headers; check for linux instead. PiperOrigin-RevId: 329362762
Diffstat (limited to 'test/util')
-rw-r--r--test/util/fs_util.cc8
-rw-r--r--test/util/fs_util.h4
-rw-r--r--test/util/test_util_runfiles.cc4
3 files changed, 6 insertions, 10 deletions
diff --git a/test/util/fs_util.cc b/test/util/fs_util.cc
index dffa16183..572675622 100644
--- a/test/util/fs_util.cc
+++ b/test/util/fs_util.cc
@@ -15,9 +15,9 @@
#include "test/util/fs_util.h"
#include <dirent.h>
-#ifndef __fuchsia__
+#ifdef __linux__
#include <linux/magic.h>
-#endif // __fuchsia__
+#endif // __linux__
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/types.h>
@@ -633,7 +633,7 @@ PosixErrorOr<std::string> ProcessExePath(int pid) {
return ReadLink(absl::StrCat("/proc/", pid, "/exe"));
}
-#ifndef __fuchsia__
+#ifdef __linux__
PosixErrorOr<bool> IsTmpfs(const std::string& path) {
struct statfs stat;
if (statfs(path.c_str(), &stat)) {
@@ -647,7 +647,7 @@ PosixErrorOr<bool> IsTmpfs(const std::string& path) {
}
return stat.f_type == TMPFS_MAGIC;
}
-#endif // __fuchsia__
+#endif // __linux__
} // namespace testing
} // namespace gvisor
diff --git a/test/util/fs_util.h b/test/util/fs_util.h
index 044190657..314637de0 100644
--- a/test/util/fs_util.h
+++ b/test/util/fs_util.h
@@ -179,10 +179,10 @@ std::string CleanPath(absl::string_view path);
// Returns the full path to the executable of the given pid or a PosixError.
PosixErrorOr<std::string> ProcessExePath(int pid);
-#ifndef __fuchsia__
+#ifdef __linux__
// IsTmpfs returns true if the file at path is backed by tmpfs.
PosixErrorOr<bool> IsTmpfs(const std::string& path);
-#endif // __fucshia__
+#endif // __linux__
namespace internal {
// Not part of the public API.
diff --git a/test/util/test_util_runfiles.cc b/test/util/test_util_runfiles.cc
index 694d21692..7210094eb 100644
--- a/test/util/test_util_runfiles.cc
+++ b/test/util/test_util_runfiles.cc
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef __fuchsia__
-
#include <iostream>
#include <string>
@@ -46,5 +44,3 @@ std::string RunfilePath(std::string path) {
} // namespace testing
} // namespace gvisor
-
-#endif // __fuchsia__