Merge topic 'update-kwsys'

1b6fbdf1d7 Merge branch 'upstream-KWSys' into update-kwsys
fc5b7905ed KWSys 2021-06-02 (ad35b3ba)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6183
This commit is contained in:
Brad King
2021-06-03 12:06:14 +00:00
committed by Kitware Robot

View File

@@ -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 &&