Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/smbfs/dist more dead functions, usage to stderr
details: https://anonhg.NetBSD.org/src/rev/1b9e2c2b1912
branches: trunk
changeset: 325482:1b9e2c2b1912
user: christos <christos%NetBSD.org@localhost>
date: Thu Dec 26 16:52:36 2013 +0000
description:
more dead functions, usage to stderr
diffstat:
external/bsd/smbfs/dist/mount_smbfs/mount_smbfs.c | 6 ++--
external/bsd/smbfs/dist/smbutil/common.h | 24 +++++++++++-----------
external/bsd/smbfs/dist/smbutil/login.c | 13 ++++++-----
external/bsd/smbfs/dist/smbutil/lookup.c | 3 +-
external/bsd/smbfs/dist/smbutil/print.c | 7 ++---
external/bsd/smbfs/dist/smbutil/smbutil.c | 23 ++++++++++-----------
external/bsd/smbfs/dist/smbutil/view.c | 6 ++--
7 files changed, 41 insertions(+), 41 deletions(-)
diffs (220 lines):
diff -r 9c276098f833 -r 1b9e2c2b1912 external/bsd/smbfs/dist/mount_smbfs/mount_smbfs.c
--- a/external/bsd/smbfs/dist/mount_smbfs/mount_smbfs.c Thu Dec 26 16:42:28 2013 +0000
+++ b/external/bsd/smbfs/dist/mount_smbfs/mount_smbfs.c Thu Dec 26 16:52:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mount_smbfs.c,v 1.3 2013/12/26 16:42:28 christos Exp $ */
+/* $NetBSD: mount_smbfs.c,v 1.4 2013/12/26 16:52:36 christos Exp $ */
/*
* Copyright (c) 2000-2002, Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: mount_smbfs.c,v 1.3 2013/12/26 16:42:28 christos Exp $");
+__RCSID("$NetBSD: mount_smbfs.c,v 1.4 2013/12/26 16:52:36 christos Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@@ -65,7 +65,7 @@
#include "mntopts.h"
-static void usage(void) __noreturn;
+static void usage(void) __dead;
static const struct mntopt mopts[] = {
MOPT_STDOPTS,
diff -r 9c276098f833 -r 1b9e2c2b1912 external/bsd/smbfs/dist/smbutil/common.h
--- a/external/bsd/smbfs/dist/smbutil/common.h Thu Dec 26 16:42:28 2013 +0000
+++ b/external/bsd/smbfs/dist/smbutil/common.h Thu Dec 26 16:52:36 2013 +0000
@@ -7,17 +7,17 @@
extern int verbose;
-int cmd_dumptree(int argc, char *argv[]);
-int cmd_login(int argc, char *argv[]);
-int cmd_logout(int argc, char *argv[]);
-int cmd_lookup(int argc, char *argv[]);
-int cmd_print(int argc, char *argv[]);
-int cmd_view(int argc, char *argv[]);
-void login_usage(void);
-void logout_usage(void);
-void lookup_usage(void);
-void print_usage(void);
-void view_usage(void);
+int cmd_dumptree(int, char *[]);
+int cmd_login(int, char *[]);
+int cmd_logout(int, char *[]);
+int cmd_lookup(int, char *[]);
+int cmd_print(int, char *[]);
+int cmd_view(int, char *[]);
+void login_usage(void) __dead;
+void logout_usage(void) __dead;
+void lookup_usage(void) __dead;
+void print_usage(void) __dead;
+void view_usage(void) __dead;
#ifdef APPLE
-extern int loadsmbvfs();
+extern int loadsmbvfs(void);
#endif
diff -r 9c276098f833 -r 1b9e2c2b1912 external/bsd/smbfs/dist/smbutil/login.c
--- a/external/bsd/smbfs/dist/smbutil/login.c Thu Dec 26 16:42:28 2013 +0000
+++ b/external/bsd/smbfs/dist/smbutil/login.c Thu Dec 26 16:52:36 2013 +0000
@@ -40,6 +40,7 @@
#include <strings.h>
#include <stdlib.h>
#include <sysexits.h>
+#include <util.h>
#include <cflib.h>
@@ -195,17 +196,17 @@
void
login_usage(void)
{
- printf(
- "usage: smbutil login [-E cs1:cs2] [-I host] [-L locale] [-M crights:srights]\n"
- " [-N cowner:cgroup/sowner:sgroup] [-P]\n"
- " [-R retrycount] [-T timeout]\n"
- " [-W workgroup] //user@server\n");
+ fprintf(stderr, "Usage: %s login [-E cs1:cs2] [-I host] [-L locale] "
+ "[-M crights:srights]\n"
+ "\t[-N cowner:cgroup/sowner:sgroup] [-P]\n"
+ "\t[-R retrycount] [-T timeout]\n"
+ "\t[-W workgroup] //user@server\n", getprogname());
exit(1);
}
void
logout_usage(void)
{
- printf("usage: smbutil logout [user@server]\n");
+ fprintf(stderr, "Usage: %s logout [user@server]\n", getprogname());
exit(1);
}
diff -r 9c276098f833 -r 1b9e2c2b1912 external/bsd/smbfs/dist/smbutil/lookup.c
--- a/external/bsd/smbfs/dist/smbutil/lookup.c Thu Dec 26 16:42:28 2013 +0000
+++ b/external/bsd/smbfs/dist/smbutil/lookup.c Thu Dec 26 16:52:36 2013 +0000
@@ -41,6 +41,7 @@
#include <strings.h>
#include <stdlib.h>
#include <sysexits.h>
+#include <util.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -105,6 +106,6 @@
void
lookup_usage(void)
{
- printf("usage: smbutil lookup [-w host] name\n");
+ fprintf(stderr, "Usage: %s lookup [-w host] name\n", getprogname());
exit(1);
}
diff -r 9c276098f833 -r 1b9e2c2b1912 external/bsd/smbfs/dist/smbutil/print.c
--- a/external/bsd/smbfs/dist/smbutil/print.c Thu Dec 26 16:42:28 2013 +0000
+++ b/external/bsd/smbfs/dist/smbutil/print.c Thu Dec 26 16:52:36 2013 +0000
@@ -42,6 +42,7 @@
#include <strings.h>
#include <stdlib.h>
#include <sysexits.h>
+#include <util.h>
#include <cflib.h>
@@ -145,9 +146,7 @@
void
print_usage(void)
{
- printf(
- "usage: smbutil print [connection optinons] //user@server/share\n"
- );
+ fprintf(stderr, "Usage: %s print [connection options] "
+ "//user@server/share\n", getprogname());
exit(1);
}
-
diff -r 9c276098f833 -r 1b9e2c2b1912 external/bsd/smbfs/dist/smbutil/smbutil.c
--- a/external/bsd/smbfs/dist/smbutil/smbutil.c Thu Dec 26 16:42:28 2013 +0000
+++ b/external/bsd/smbfs/dist/smbutil/smbutil.c Thu Dec 26 16:52:36 2013 +0000
@@ -6,30 +6,29 @@
#include <stdlib.h>
#include <err.h>
#include <sysexits.h>
+#include <util.h>
#include <netsmb/smb_lib.h>
#include <netsmb/smb_conn.h>
#include "common.h"
-extern char *__progname;
-
-static void help(void);
-static void help_usage(void);
-static int cmd_crypt(int argc, char *argv[]);
-static int cmd_help(int argc, char *argv[]);
+static void help(void) __dead;
+static void help_usage(void) __dead;
+static int cmd_crypt(int, char *[]);
+static int cmd_help(int, char *[]);
int verbose;
-typedef int cmd_fn_t (int argc, char *argv[]);
-typedef void cmd_usage_t (void);
+typedef int (*cmd_fn_t)(int, char *[]);
+typedef void (*cmd_usage_t)(void) __dead;
#define CMDFL_NO_KMOD 0x0001
static struct commands {
const char * name;
- cmd_fn_t* fn;
- cmd_usage_t * usage;
+ cmd_fn_t fn;
+ cmd_usage_t usage;
int flags;
} commands[] = {
{ "crypt", cmd_crypt, NULL, CMDFL_NO_KMOD },
@@ -139,7 +138,7 @@
static void
help(void) {
printf("\n");
- printf("usage: %s [-hv] command [args]\n", __progname);
+ printf("Usage: %s [-hv] command [args]\n", getprogname());
printf("where commands are:\n"
" crypt [password] slightly encrypt password\n"
" help command display help on \"command\"\n"
@@ -154,6 +153,6 @@
static void
help_usage(void) {
- printf("usage: smbutil help command\n");
+ fprintf(stderr, "Usage: %s help command\n", getprogname());
exit(1);
}
diff -r 9c276098f833 -r 1b9e2c2b1912 external/bsd/smbfs/dist/smbutil/view.c
--- a/external/bsd/smbfs/dist/smbutil/view.c Thu Dec 26 16:42:28 2013 +0000
+++ b/external/bsd/smbfs/dist/smbutil/view.c Thu Dec 26 16:52:36 2013 +0000
@@ -42,6 +42,7 @@
#include <strings.h>
#include <stdlib.h>
#include <sysexits.h>
+#include <util.h>
#include <cflib.h>
@@ -128,9 +129,8 @@
void
view_usage(void)
{
- printf(
- "usage: smbutil view [connection optinons] //[user@]server\n"
- );
+ fprintf(stderr, "Usage: %s view [connection options] //[user@]server\n",
+ getprogname());
exit(1);
}
Home |
Main Index |
Thread Index |
Old Index