@@ -547,7 +547,9 @@ my_am_cflags="\
-pipe \
-Wall \
-Wextra \
- -Wstrict-prototypes \
+ -Werror=strict-prototypes \
+ -Werror=missing-prototypes \
+ -Werror=missing-declarations \
"
AC_SUBST([AM_CFLAGS], ["$my_am_cflags"])
@@ -6,6 +6,7 @@
#include <string.h>
#include "xcommon.h"
#include <sys/stat.h>
+#include "misc.h"
int
is_mountpoint(char *path)
@@ -28,6 +28,8 @@
#include <unistd.h>
#include <errno.h>
+#include "nfslib.h"
+
/*
* ensure all of data on socket comes through. f==read || f==write
*/
@@ -9,6 +9,8 @@
#include <dirent.h>
#include <errno.h>
+#include "nfslib.h"
+
void
closeall(int min)
{
@@ -32,6 +32,7 @@
#include <unistd.h>
#include <time.h>
#include "nfslib.h"
+#include "rpcmisc.h"
#if SIZEOF_SOCKLEN_T - 0 == 0
#define socklen_t int
@@ -38,6 +38,8 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp
#include "config.h"
#endif /* HAVE_CONFIG_H */
+#include "nfslib.h"
+
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
@@ -38,6 +38,8 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp
#include "config.h"
#endif /* HAVE_CONFIG_H */
+#include "nfslib.h"
+
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
@@ -25,6 +25,8 @@
#include <sys/fcntl.h>
#include <errno.h>
#include "xlog.h"
+#include "rpcmisc.h"
+#include "nfslib.h"
#include "config.h"
@@ -41,6 +41,7 @@
#endif
#include <ctype.h>
+#include "nfslib.h"
#define TRUE 1
#define FALSE 0
@@ -64,6 +64,7 @@
#pragma GCC visibility push(hidden)
+void nfs4_cleanup_name_mapping(void);
static char *default_domain;
static struct mapping_plugin **nfs4_plugins = NULL;
static struct mapping_plugin **gss_plugins = NULL;
@@ -327,7 +328,7 @@ out:
return ret;
}
-char * get_default_domain(void)
+static char *get_default_domain(void)
{
int ret;
@@ -51,6 +51,7 @@ struct trans_func {
extern int idmap_verbosity;
extern nfs4_idmap_log_function_t idmap_log_func;
+struct trans_func *libnfsidmap_plugin_init(void);
/* Level zero always prints, others print depending on verbosity level */
#define IDMAP_LOG(LVL, MSG) \
@@ -436,7 +436,7 @@ out:
return err;
}
-int nss_gss_princ_to_grouplist(char *secname, char *princ,
+static int nss_gss_princ_to_grouplist(char *secname, char *princ,
gid_t *groups, int *ngroups,
extra_mapping_params **UNUSED(ex))
{
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
+#include "systemd.h"
static const char hex[16] =
{
@@ -81,7 +81,7 @@ int bl_watch_fd, bl_pipe_fd, nfs_pipedir_wfd, rpc_pipedir_wfd;
int pidfd = -1;
-struct bl_disk_path *bl_get_path(const char *filepath,
+static struct bl_disk_path *bl_get_path(const char *filepath,
struct bl_disk_path *paths)
{
struct bl_disk_path *tmp = paths;
@@ -103,7 +103,7 @@ struct bl_disk_path *bl_get_path(const char *filepath,
* exist for each multipath device. If not, active device path will be
* chosen for device creation.
*/
-int bl_update_path(enum bl_path_state_e state, struct bl_disk *disk)
+static int bl_update_path(enum bl_path_state_e state, struct bl_disk *disk)
{
struct bl_disk_path *valid_path = disk->valid_path;
@@ -112,7 +112,7 @@ int bl_update_path(enum bl_path_state_e state, struct bl_disk *disk)
return 1;
}
-void bl_release_disk(void)
+static void bl_release_disk(void)
{
struct bl_disk *disk;
struct bl_disk_path *path = NULL;
@@ -133,7 +133,7 @@ void bl_release_disk(void)
}
}
-void bl_add_disk(char *filepath)
+static void bl_add_disk(char *filepath)
{
struct bl_disk *disk = NULL;
int fd = 0;
@@ -435,7 +435,7 @@ static int bl_event_helper(void)
return ret;
}
-void sig_die(int signal)
+static void sig_die(int signal)
{
if (pidfd >= 0) {
close(pidfd);
@@ -210,7 +210,7 @@ static int dm_device_remove_byname(const char *dev_name)
return ret;
}
-int dm_device_remove(uint64_t dev)
+static int dm_device_remove(uint64_t dev)
{
struct dm_task *dmt;
struct dm_names *dmnames;
@@ -36,6 +36,7 @@
#include <stdarg.h>
#include <string.h>
#include "xlog.h"
+#include "err_util.h"
static int verbosity = 0;
static int fg = 0;
@@ -51,6 +51,7 @@
#include "svcgssd.h"
#include "gss_util.h"
+#include "gss_names.h"
#include "err_util.h"
#include "context.h"
#include "misc.h"
@@ -473,7 +473,7 @@ change_identity(uid_t uid)
return 0;
}
-AUTH *
+static AUTH *
krb5_not_machine_creds(struct clnt_info *clp, uid_t uid, char *tgtname,
int *downcall_err, int *chg_err, CLIENT **rpc_clnt)
{
@@ -519,7 +519,7 @@ out:
return auth;
}
-AUTH *
+static AUTH *
krb5_use_machine_creds(struct clnt_info *clp, uid_t uid, char *tgtname,
char *service, CLIENT **rpc_clnt)
{
@@ -65,7 +65,7 @@
struct state_paths etab;
-void
+static void
sig_die(int signal)
{
/* destroy krb5 machine creds */
@@ -73,7 +73,7 @@ sig_die(int signal)
exit(0);
}
-void
+static void
sig_hup(int signal)
{
/* don't exit on SIGHUP */
@@ -41,6 +41,7 @@
#include <gssapi/gssapi.h>
#include <string.h>
+char * mech2file(gss_OID mech);
#define g_OID_equal(o1,o2) \
(((o1)->length == (o2)->length) && \
@@ -196,7 +196,7 @@ flush_nfsd_idmap_cache(void)
return ret;
}
-void usage(char *progname)
+static void usage(char *progname)
{
fprintf(stderr, "Usage: %s [-hfvCS] [-p path] [-c path]\n",
basename(progname));
@@ -35,6 +35,10 @@
#include "network.h"
#include "conffile.h"
+char *mountopts_convert(char *value);
+char *is_alias(char *opt);
+char *conf_get_mntopts(char *spec, char *mount_point, char *mount_opts);
+
#define KBYTES(x) ((x) * (1024))
#define MEGABYTES(x) ((x) * (1048576))
#define GIGABYTES(x) ((x) * (1073741824))
@@ -45,6 +45,8 @@
#include "error.h"
#include "utils.h"
+char *retrieve_mount_options(struct libmnt_fs *fs);
+
char *progname;
int nfs_mount_data_version;
int verbose;
@@ -57,6 +57,7 @@
#include <rpc/rpc_com.h>
#endif
+void my_svc_run(void);
void cache_set_fds(fd_set *fdset);
int cache_process_req(fd_set *readfds);
@@ -51,6 +51,7 @@
#include <linux/limits.h>
#include "xlog.h"
+#include "sqlite.h"
#define CLTRACK_SQLITE_LATEST_SCHEMA_VERSION 2
@@ -203,7 +204,7 @@ rollback:
* then insert schema version into the parameters table and commit the
* transaction. On any error, rollback the transaction.
*/
-int
+static int
sqlite_maindb_init_v2(void)
{
int ret, ret2;
@@ -300,7 +300,7 @@ int versions[] = {
PRNT_V4
};
-void usage(char *name)
+static void usage(char *name)
{
printf("Usage: %s [OPTION]...\n\
\n\
@@ -56,6 +56,7 @@
#include "statd.h"
#include "notlist.h"
+void my_svc_exit(void);
static int svc_stop = 0;
/*
Added the -Werror=missing-prototypes warning flag then cleaned up the mess. Signed-off-by: Steve Dickson <steved@redhat.com> --- configure.ac | 4 +++- support/misc/mountpoint.c | 1 + support/nfs/atomicio.c | 2 ++ support/nfs/closeall.c | 2 ++ support/nfs/rpcmisc.c | 1 + support/nfs/strlcat.c | 2 ++ support/nfs/strlcpy.c | 2 ++ support/nfs/svc_socket.c | 2 ++ support/nfs/wildmat.c | 1 + support/nfsidmap/libnfsidmap.c | 3 ++- support/nfsidmap/nfsidmap_plugin.h | 1 + support/nfsidmap/nss.c | 2 +- systemd/systemd.c | 1 + utils/blkmapd/device-discovery.c | 10 +++++----- utils/blkmapd/dm-device.c | 2 +- utils/gssd/err_util.c | 1 + utils/gssd/gss_names.c | 1 + utils/gssd/gssd_proc.c | 4 ++-- utils/gssd/svcgssd.c | 4 ++-- utils/gssd/svcgssd_mech2file.c | 1 + utils/idmapd/idmapd.c | 2 +- utils/mount/configfile.c | 4 ++++ utils/mount/mount_libmount.c | 2 ++ utils/mountd/svc_run.c | 1 + utils/nfsdcltrack/sqlite.c | 3 ++- utils/nfsstat/nfsstat.c | 2 +- utils/statd/svc_run.c | 1 + 27 files changed, 46 insertions(+), 16 deletions(-)