1 /*
2 *
3 * Copyright (c) 2003 The Regents of the University of California. All
4 * rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * - Neither the name of the University nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
21 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 */
30
31 /*
32 * FUSDd_main.c
33 *
34 * Start Non-DevFS and Networking daemon
35 */
36
37 #include "fusdd_i.h"
38 #include <stdio.h>
39 #include <getopt.h>
40 #include <stdlib.h>
41 #include <unistd.h>
42
43 int unlink_dirs = 0;
44
45 static void usage(void)
46 {
47 fprintf(stderr,
48 "fusdd release: %s\n"
49 "\n"
50 "usage: fusdd [-v] [-U] [-T]\n"
51 "\n"
52 "-v: Verbose mode\n"
53 "-T: Test driver\n"
54 "-U: unlink dirs when empty\n"
55 "\n"
56 ,CVSTAG
57 );
58 exit(1);
59 }
60
61
62 int main(int argc, char **argv)
63 {
64 int verbose=0;
65 int arg;
66
67 /********** Parse command-line arguments ************/
68
69 opterr = 0;
70 while ((arg = getopt(argc, argv, "hvnT")) != EOF) {
71 switch (arg) {
72 default:
73 case '?':
74 fprintf(stderr, "invalid option '-%c' (use -h for help)", optopt);
75 case 'h':
76 usage();
77 break;
78
79 case 'U':
80 unlink_dirs = 1;
81 break;
82
83 case 'T':
84 dev_test();
85 exit(1);
86 break;
87
88 case 'v':
89 verbose = 1;
90 break;
91 }
92 }
93
94 /* advance past parsed options */
95 argc -= optind;
96 argv += optind;
97
98 /* spawn fusdd */
99 start_fusdd(verbose);
100
101 /* done */
102 fprintf(stderr, "FUSDd startup OK.\n");
103 return 0;
104 }
105
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.