From: Paul Eggert Date: Mon, 21 Aug 2006 22:05:23 +0000 (+0000) Subject: BeOS portability. X-Git-Tag: cvs-readonly~2013 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=c6957a1d1b3e198bddd06078c3509aed646376b8;p=gnulib.git BeOS portability. * lib/dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist. * m4/mkdir-p.m4 (gl_MKDIR_PARENTS): Check for fchmod. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 5705f2a6d..609336fdb 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,4 +1,10 @@ -2006-08-19 Bruno Haible +2006-08-21 Paul Eggert + + BeOS portability. + * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist. + Problem reported by Bruno Haible. + +2006-08-21 Bruno Haible BeOS portability. * mbchar.h: Include only if it exists. diff --git a/lib/dirchownmod.c b/lib/dirchownmod.c index 50e5fe117..4c76d59ac 100644 --- a/lib/dirchownmod.c +++ b/lib/dirchownmod.c @@ -40,6 +40,12 @@ # define O_NOFOLLOW 0 #endif +#ifndef HAVE_FCHMOD +# define HAVE_FCHMOD 0 +# undef fchmod +# define fchmod(fd, mode) (-1) +#endif + /* Change the ownership and mode bits of the directory DIR. If MKDIR_MODE is not (mode_t) -1, mkdir (DIR, MKDIR_MODE) has just @@ -134,7 +140,7 @@ dirchownmod (char const *dir, mode_t mkdir_mode, { mode_t chmod_mode = mode | (dir_mode & CHMOD_MODE_BITS & ~mode_bits); - result = (0 <= fd + result = (HAVE_FCHMOD && 0 <= fd ? fchmod (fd, chmod_mode) : mkdir_mode != (mode_t) -1 ? lchmod (dir, chmod_mode) diff --git a/m4/ChangeLog b/m4/ChangeLog index 7813a7a93..41d7152bd 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,5 +1,7 @@ 2006-08-21 Paul Eggert + * mkdir-p.m4 (gl_MKDIR_PARENTS): Check for fchmod. + * argmatch.m4: New file, from coreutils with AC_LIBSOURCES removed. * dev-ino.m4, same-inode.m4: Remove. diff --git a/m4/mkdir-p.m4 b/m4/mkdir-p.m4 index 9317fa4dd..8f1e48d32 100644 --- a/m4/mkdir-p.m4 +++ b/m4/mkdir-p.m4 @@ -1,4 +1,4 @@ -# mkdir-p.m4 serial 12 +# mkdir-p.m4 serial 13 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -12,4 +12,5 @@ AC_DEFUN([gl_MKDIR_PARENTS], dnl Prerequisites of lib/dirchownmod.c. AC_REQUIRE([gl_FUNC_LCHMOD]) AC_REQUIRE([gl_FUNC_LCHOWN]) + AC_CHECK_FUNCS_ONCE([fchmod]) ])