Compiling coreutils-6.0 on BeOS, we have this warning: source='dirchownmod.c' object='dirchownmod.o' libtool=no \ DEPDIR=.deps depmode=gcc /bin/sh ../build-aux/depcomp \ gcc -DHAVE_CONFIG_H -DLIBDIR=\"/boot/home/config/lib\" -I. -I. -I.. -I.. -I. -Wall -I/boot/home/config/include -g -O2 -c dirchownmod.c /boot/home/gnubuild/coreutils-6.0/lib/dirchownmod.c: In function `dirchownmod': /boot/home/gnubuild/coreutils-6.0/lib/dirchownmod.c:118: warning: implicit declaration of function `lchown' /boot/home/gnubuild/coreutils-6.0/lib/dirchownmod.c:138: warning: implicit declaration of function `fchmod'
followed by this link error: gcc -g -O2 -o ginstall install.o copy.o cp-hash.o ../lib/libcoreutils.a /boot/home/config/lib/libintl.so -L/boot/home/config/lib /boot/home/config/lib/libiconv.so -Wl,-rpath -Wl,/boot/home/config/lib ../lib/libcoreutils.a ../lib/libcoreutils.a(mkdir-p.o): In function `dirchownmod': /boot/home/gnubuild/coreutils-6.0/lib/dirchownmod.c:137: undefined reference to `fchmod' collect2: ld returned 1 exit status make[3]: *** [ginstall] Error 1 make[3]: Leaving directory `/boot/home/gnubuild/coreutils-6.0/src' The reason is that BeOS doesn't have fchmod. This fixes it. 2006-08-19 Bruno Haible <[EMAIL PROTECTED]> BeOS portability. * lib/dirchownmod.c (dirchownmod): Fall back to lchmod or chmod if fchmod doesn't exist. *** lib/dirchownmod.c.bak 2006-07-17 05:05:23.000000000 +0200 --- lib/dirchownmod.c 2006-08-19 14:47:17.000000000 +0200 *************** *** 134,144 **** { mode_t chmod_mode = mode | (dir_mode & CHMOD_MODE_BITS & ~mode_bits); ! result = (0 <= fd ! ? fchmod (fd, chmod_mode) ! : mkdir_mode != (mode_t) -1 ! ? lchmod (dir, chmod_mode) ! : chmod (dir, chmod_mode)); } } } --- 134,147 ---- { mode_t chmod_mode = mode | (dir_mode & CHMOD_MODE_BITS & ~mode_bits); ! #if HAVE_FCHMOD ! if (0 <= fd) ! result = fchmod (fd, chmod_mode); ! else ! #endif ! result = (mkdir_mode != (mode_t) -1 ! ? lchmod (dir, chmod_mode) ! : chmod (dir, chmod_mode)); } } }