isdir: clean up, since at least grep still uses it
authorJim Meyering <meyering@redhat.com>
Sat, 26 Dec 2009 08:56:23 +0000 (09:56 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 26 Dec 2009 09:56:00 +0000 (10:56 +0100)
* lib/isdir.c: Include "isdir.h".
(S_ISDIR): Remove now-unneeded definition.
* modules/isdir (Files): Add lib/isdir.h.
* lib/isdir.h: New file, with declaration.
* m4/isdir.m4: Remove file -- unneeded.

ChangeLog
lib/isdir.c
lib/isdir.h [new file with mode: 0644]
m4/isdir.m4 [deleted file]
modules/isdir

index acdc7c114401fc9e48b9b2458a5a61fc4d62a3e5..088bb3bab8466abaa5dd366fffdead32b4092537 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-26  Jim Meyering  <meyering@redhat.com>
+
+       isdir: clean up, since at least grep still uses it
+       * lib/isdir.c: Include "isdir.h".
+       (S_ISDIR): Remove now-unneeded definition.
+       * modules/isdir (Files): Add lib/isdir.h.
+       * lib/isdir.h: New file, with declaration.
+       * m4/isdir.m4: Remove file -- unneeded.
+
 2009-12-25  Bruno Haible  <bruno@clisp.org>
 
        selinux-h: Make generated .h files standalone.
index 0f9aec2f9cae0fe9a4c553a0e0fce3f034ecf416..19a3f7d9b181d5c3493f3204e3a4d66d06d747b0 100644 (file)
@@ -1,6 +1,6 @@
 /* isdir.c -- determine whether a directory exists
 
-   Copyright (C) 1990, 1998, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1998, 2006, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include <config.h>
 
+#include "isdir.h"
+
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#if STAT_MACROS_BROKEN
-# undef S_ISDIR
-#endif
-
-#if !defined S_ISDIR && defined S_IFDIR
-# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR)
-#endif
-
 /* If PATH is an existing directory or symbolic link to a directory,
    return nonzero, else 0.  */
-
 int
 isdir (const char *path)
 {
diff --git a/lib/isdir.h b/lib/isdir.h
new file mode 100644 (file)
index 0000000..80116bc
--- /dev/null
@@ -0,0 +1 @@
+int isdir (const char *path);
diff --git a/m4/isdir.m4 b/m4/isdir.m4
deleted file mode 100644 (file)
index 2624856..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# isdir.m4 serial 2
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_ISDIR],
-[
-  dnl Prerequisites of lib/isdir.c.
-  AC_REQUIRE([AC_HEADER_STAT])
-])
index 001546ea82dab3420f22e3cce870a0e453f405e5..83193e1295d17dbc297be19212552c579b9c5f17 100644 (file)
@@ -3,7 +3,7 @@ Determine whether a directory exists.
 
 Files:
 lib/isdir.c
-m4/isdir.m4
+lib/isdir.h
 
 Depends-on:
 stat