summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-02 07:46:47 -0400
committerBrad King <brad.king@kitware.com>2021-06-02 07:46:47 -0400
commit1b6fbdf1d7b2f83f6da3a8e1258aa25fd331514b (patch)
tree087efe145a2d918c139669b7c7eb93d2130a3bf4
parentcf470d8dac5abe956b7a0ec62afe2d93fb533336 (diff)
parentfc5b7905ed8e2ddc45de1cabe0f9dbd8c1484dbb (diff)
downloadcmake-1b6fbdf1d7b2f83f6da3a8e1258aa25fd331514b.tar.gz
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream * upstream-KWSys: KWSys 2021-06-02 (ad35b3ba)
-rw-r--r--Source/kwsys/testSystemTools.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 700eaf7ebf..39a19cbf24 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -332,9 +332,10 @@ static bool CheckFileOperations()
// While we're at it, check proper TestFileAccess functionality.
bool do_write_test = true;
-#if defined(__linux__)
- // If we are running as root on linux ignore this check, as
- // root can always write to files
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
+ defined(__NetBSD__) || defined(__DragonFly__)
+ // If we are running as root on POSIX-ish systems (Linux and the BSDs,
+ // at least), ignore this check, as root can always write to files.
do_write_test = (getuid() != 0);
#endif
if (do_write_test &&