From 0c363304f645105a776fac77223e218e7b8f41e0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 9 Sep 2003 22:27:55 +0000 Subject: [PATCH] Remove K&R cruft. --- lib/mkdir.c | 21 ++++----------------- lib/rmdir.c | 6 +++--- lib/savedir.c | 9 ++++----- m4/mkdir-slash.m4 | 6 +----- m4/savedir.m4 | 5 ++--- 5 files changed, 14 insertions(+), 33 deletions(-) diff --git a/lib/mkdir.c b/lib/mkdir.c index 7c756a283..c3ecc721e 100644 --- a/lib/mkdir.c +++ b/lib/mkdir.c @@ -1,6 +1,7 @@ /* On some systems, mkdir ("foo/", 0700) fails because of the trailing slash. On those systems, this wrapper removes the trailing slash. - Copyright (C) 2001 Free Software Foundation, Inc. + + Copyright (C) 2001, 2003 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 @@ -28,26 +29,12 @@ #include #include #include -#if HAVE_STDLIB_H -# include -#endif - -#if HAVE_STRING_H -# include -#else -# include -#endif +#include +#include #include "dirname.h" #include "xalloc.h" -#ifndef HAVE_DECL_FREE -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_FREE -void free (); -#endif - /* This function is required at least for NetBSD 1.5.2. */ int diff --git a/lib/rmdir.c b/lib/rmdir.c index 2a92803db..5315711c3 100644 --- a/lib/rmdir.c +++ b/lib/rmdir.c @@ -1,5 +1,6 @@ /* BSD compatible remove directory function for System V - Copyright (C) 1988, 1990 Free Software Foundation, Inc. + + Copyright (C) 1988, 1990, 1999, 2003 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 @@ -41,8 +42,7 @@ extern int errno; Return 0 if successful, -1 if not. */ int -rmdir (dpath) - char *dpath; +rmdir (char const *dpath) { pid_t cpid; int status; diff --git a/lib/savedir.c b/lib/savedir.c index a1f8a6cd7..1cab9b6c5 100644 --- a/lib/savedir.c +++ b/lib/savedir.c @@ -23,6 +23,8 @@ # include #endif +#include "savedir.h" + #include #include @@ -52,13 +54,10 @@ extern int errno; # define CLOSEDIR(d) closedir (d) #endif -#ifdef STDC_HEADERS -# include -# include -#endif #include +#include +#include -#include "savedir.h" #include "xalloc.h" /* Return a freshly allocated string containing the filenames diff --git a/m4/mkdir-slash.m4 b/m4/mkdir-slash.m4 index 3ca909e6c..84c9415f2 100644 --- a/m4/mkdir-slash.m4 +++ b/m4/mkdir-slash.m4 @@ -36,8 +36,4 @@ AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH], ]) # Prerequisites of lib/mkdir.c. -AC_DEFUN([gl_PREREQ_MKDIR], -[ - AC_CHECK_HEADERS_ONCE(stdlib.h string.h) - AC_CHECK_DECLS_ONCE(free) -]) +AC_DEFUN([gl_PREREQ_MKDIR], [:]) diff --git a/m4/savedir.m4 b/m4/savedir.m4 index 5bbead54d..9b8afce67 100644 --- a/m4/savedir.m4 +++ b/m4/savedir.m4 @@ -1,5 +1,5 @@ -# savedir.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# savedir.m4 serial 2 +dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program @@ -9,7 +9,6 @@ dnl the same distribution terms as the rest of that program. AC_DEFUN([gl_SAVEDIR], [ dnl Prerequisites of lib/savedir.c. - AC_REQUIRE([AC_HEADER_STDC]) AC_REQUIRE([AC_HEADER_DIRENT]) AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID]) ]) -- 2.11.0