* lib/fsusage.c (UNUSED_PARAM): Define.
(get_fs_usage): Mark parameter "disk" as unused.
* lib/getugroups.c (getgrent): Use "void" in prototype.
* lib/mountlist.c: Mark unused parameters.
(read_file_system_list): Declare a local with "const".
* lib/nanosleep.c (getnow): Declare static.
* lib/strftime.c: Include strftime.h, for declaration of nstrftime.
2009-02-04 Jim Meyering <meyering@redhat.com>
+ avoid misc. warnings
+ * lib/fsusage.c (UNUSED_PARAM): Define.
+ (get_fs_usage): Mark parameter "disk" as unused.
+ * lib/getugroups.c (getgrent): Use "void" in prototype.
+ * lib/mountlist.c: Mark unused parameters.
+ (read_file_system_list): Declare a local with "const".
+ * lib/nanosleep.c (getnow): Declare static.
+ * lib/strftime.c: Include strftime.h, for declaration of nstrftime.
+
dirfd: set errno upon failure
* lib/dirfd.c: Include <errno.h>.
Set errno to ENOTSUP when returning -1.
/* fsusage.c -- return space usage of mounted file systems
- Copyright (C) 1991, 1992, 1996, 1998, 1999, 2002, 2003, 2004, 2005, 2006
+ Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2008
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
otherwise, use PROPAGATE_ALL_ONES. */
#define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1))
+#ifdef STAT_READ_FILSYS
+# define UNUSED_PARAM /* empty */
+#else
+# define UNUSED_PARAM _UNUSED_PARAMETER_
+#endif
+
/* Fill in the fields of FSP with information about space usage for
the file system on which FILE resides.
DISK is the device on which FILE is mounted, for space-getting
ERRNO is either a system error value, or zero if DISK is NULL
on a system that requires a non-NULL value. */
int
-get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
+get_fs_usage (char const *file, char const *disk UNUSED_PARAM,
+ struct fs_usage *fsp)
{
#if defined STAT_STATVFS /* POSIX */
/* Some old header files might not declare setgrent, getgrent, and endgrent.
If you don't have them at all, we can't implement this function.
You lose! */
-struct group *getgrent ();
+struct group *getgrent (void);
#include <string.h>
/* mountlist.c -- return a list of mounted file systems
- Copyright (C) 1991, 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1997-2008 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
#if defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2
+#undef UNUSED_PARAM
+#ifdef __linux__
+# define UNUSED_PARAM _UNUSED_PARAMETER_
+#else
+# define UNUSED_PARAM
+#endif
+
/* Return the device number from MOUNT_OPTIONS, if possible.
Otherwise return (dev_t) -1. */
-
static dev_t
-dev_from_mount_options (char const *mount_options)
+dev_from_mount_options (char const *mount_options UNUSED_PARAM)
{
/* GNU/Linux allows file system implementations to define their own
meaning for "dev=" mount options, so don't trust the meaning
#endif
+#undef UNUSED_PARAM
+#ifdef GETFSTYP
+# define UNUSED_PARAM
+#else
+# define UNUSED_PARAM _UNUSED_PARAMETER_
+#endif
+
/* Return a list of the currently mounted file systems, or NULL on error.
Add each entry to the tail of the list so that they stay in order.
If NEED_FS_TYPE is true, ensure that the file system type fields in
the returned list are valid. Otherwise, they might not be. */
struct mount_entry *
-read_file_system_list (bool need_fs_type)
+read_file_system_list (bool need_fs_type UNUSED_PARAM)
{
struct mount_entry *mount_list;
struct mount_entry *me;
#ifdef MOUNTED_GETMNTENT1 /* GNU/Linux, 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
{
struct mntent *mnt;
- char *table = MOUNTED;
+ char const *table = MOUNTED;
FILE *fp;
fp = setmntent (table, "r");
#if HAVE_BUG_BIG_NANOSLEEP
-void
+static void
getnow (struct timespec *t)
{
# if defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME
# include <config.h>
# if FPRINTFTIME
# include "fprintftime.h"
+# else
+# include "strftime.h"
# endif
#endif