Sat Aug 27 22:26:05 2011 UTC ()
static + __dead


(joerg)
diff -r1.5 -r1.6 src/usr.sbin/bthcid/bthcid.c

cvs diff -r1.5 -r1.6 src/usr.sbin/bthcid/bthcid.c (expand / switch to unified diff)

--- src/usr.sbin/bthcid/bthcid.c 2009/10/05 12:34:26 1.5
+++ src/usr.sbin/bthcid/bthcid.c 2011/08/27 22:26:05 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bthcid.c,v 1.5 2009/10/05 12:34:26 plunky Exp $ */ 1/* $NetBSD: bthcid.c,v 1.6 2011/08/27 22:26:05 joerg Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Itronix Inc. 4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -23,51 +23,51 @@ @@ -23,51 +23,51 @@
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 * ON ANY THEORY OF LIABILITY, WHETHER IN 26 * ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__COPYRIGHT("@(#) Copyright (c) 2006 Itronix, Inc.\ 33__COPYRIGHT("@(#) Copyright (c) 2006 Itronix, Inc.\
34 Copyright (c) 2001-2002 Maksim Yevmenkin m_evmenkin@yahoo.com.\ 34 Copyright (c) 2001-2002 Maksim Yevmenkin m_evmenkin@yahoo.com.\
35 All rights reserved."); 35 All rights reserved.");
36__RCSID("$NetBSD: bthcid.c,v 1.5 2009/10/05 12:34:26 plunky Exp $"); 36__RCSID("$NetBSD: bthcid.c,v 1.6 2011/08/27 22:26:05 joerg Exp $");
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/stat.h> 39#include <sys/stat.h>
40#include <bluetooth.h> 40#include <bluetooth.h>
41#include <err.h> 41#include <err.h>
42#include <errno.h> 42#include <errno.h>
43#include <event.h> 43#include <event.h>
44#include <stdlib.h> 44#include <stdlib.h>
45#include <string.h> 45#include <string.h>
46#include <syslog.h> 46#include <syslog.h>
47#include <unistd.h> 47#include <unistd.h>
48#include <util.h> 48#include <util.h>
49 49
50#include "bthcid.h" 50#include "bthcid.h"
51 51
52const char *socket_name = BTHCID_SOCKET_NAME; 52static const char *socket_name = BTHCID_SOCKET_NAME;
53 int detach = 1; 53static int detach = 1;
54 54
55static struct event sighup_ev; 55static struct event sighup_ev;
56static struct event sigint_ev; 56static struct event sigint_ev;
57static struct event sigterm_ev; 57static struct event sigterm_ev;
58 58
59static void process_signal(int, short, void *); 59__dead static void process_signal(int, short, void *);
60static void usage(void); 60__dead static void usage(void);
61 61
62int 62int
63main(int argc, char *argv[]) 63main(int argc, char *argv[])
64{ 64{
65 const char *device; 65 const char *device;
66 int ch; 66 int ch;
67 mode_t mode; 67 mode_t mode;
68 68
69 device = NULL; 69 device = NULL;
70 mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; 70 mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
71 71
72 while ((ch = getopt(argc, argv, "d:fm:ns:h")) != -1) { 72 while ((ch = getopt(argc, argv, "d:fm:ns:h")) != -1) {
73 switch (ch) { 73 switch (ch) {