diff --git a/pjdfstest.c b/pjdfstest.c index 4c39e28f..aff8d78f 100644 --- a/pjdfstest.c +++ b/pjdfstest.c @@ -96,8 +96,10 @@ #define HAS_FSTATAT #define HAS_LINKAT #define HAS_MKDIRAT +#ifndef __APPLE__ #define HAS_MKFIFOAT #define HAS_MKNODAT +#endif #define HAS_OPENAT #define HAS_READLINKAT #define HAS_RENAMEAT diff --git a/tests/chmod/11.t b/tests/chmod/11.t index 94c5e5f4..5907f043 100644 --- a/tests/chmod/11.t +++ b/tests/chmod/11.t @@ -63,6 +63,12 @@ for type in regular fifo block char socket symlink; do create_file ${type} ${n1} 0640 65534 65534 expect 0 symlink ${n1} ${n2} case "${os}" in + Darwin) + expect 0 -u 65534 -g 65534 chmod ${n1} 01644 + expect 01644 stat ${n1} mode + expect 0 -u 65534 -g 65534 chmod ${n2} 01640 + expect 01640 stat ${n1} mode + ;; FreeBSD) expect EFTYPE -u 65534 -g 65534 chmod ${n1} 01644 expect 0640 stat ${n1} mode @@ -93,6 +99,10 @@ for type in regular fifo block char socket symlink; do if supported lchmod; then create_file ${type} ${n1} 0640 65534 65534 case "${os}" in + Darwin) + expect 0 -u 65534 -g 65534 lchmod ${n1} 01644 + expect 01644 lstat ${n1} mode + ;; FreeBSD) expect EFTYPE -u 65534 -g 65534 lchmod ${n1} 01644 expect 0640 lstat ${n1} mode diff --git a/tests/conf b/tests/conf index 6f7f85db..856ebf50 100644 --- a/tests/conf +++ b/tests/conf @@ -13,8 +13,8 @@ unsupported_os() get_mountpoint() { case "${os}" in - FreeBSD|Darwin) - df . | tail -1 | awk '{print $6}' + Darwin|FreeBSD) + df . | tail -1 | awk '{print $NF}' ;; *) unsupported_os @@ -23,7 +23,13 @@ get_mountpoint() } case "${os}" in -FreeBSD|Darwin) +Darwin) + GREP=grep + #fs=`df -T . | tail -1 | awk '{print $2}'` + mountpoint="`get_mountpoint`" + fs=`mount | grep "on $mountpoint" | sed -e 's/.*(//' -e 's/,.*//g' | tr '[:lower:]' '[:upper:]'` + ;; +FreeBSD) GREP=grep #fs=`df -T . | tail -1 | awk '{print $2}'` mountpoint="`get_mountpoint`"