diff options
Diffstat (limited to 'test/util')
-rw-r--r-- | test/util/fs_util.cc | 8 | ||||
-rw-r--r-- | test/util/fs_util.h | 4 | ||||
-rw-r--r-- | test/util/test_util_runfiles.cc | 4 |
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__ |