/* 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
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
#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
/* 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
Return 0 if successful, -1 if not. */
int
-rmdir (dpath)
- char *dpath;
+rmdir (char const *dpath)
{
pid_t cpid;
int status;
# include <config.h>
#endif
+#include "savedir.h"
+
#include <sys/types.h>
#include <errno.h>
# define CLOSEDIR(d) closedir (d)
#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <string.h>
-#endif
#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
-#include "savedir.h"
#include "xalloc.h"
/* Return a freshly allocated string containing the filenames
])
# 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], [:])
-# 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
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])
])