1673f4ca3cf18c0216b0d8524940ded025e9954f
[xfstests-dev.git] / dmapi / src / suite1 / cmd / init_service.c
1 /*
2  * Copyright (c) 2000-2001 Silicon Graphics, Inc.
3  * All Rights Reserved.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it would be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write the Free Software Foundation,
16  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18
19 #include <lib/hsm.h>
20
21 #include <string.h>
22
23 /*---------------------------------------------------------------------------
24
25 Test program used to test dm_init_service().  The command line is:
26
27         init_service
28
29 ----------------------------------------------------------------------------*/
30
31
32 char    *Progname;
33
34
35 static void
36 usage(void)
37 {
38         fprintf(stderr, "usage:\t%s\n", Progname);
39         exit(1);
40 }
41
42
43 int
44 main(
45         int             argc,
46         char            **argv)
47 {
48         char            *name;
49
50         if (Progname = strrchr(argv[0], '/')) {
51                 Progname++;
52         } else {
53                 Progname = argv[0];
54         }
55
56         if (argc != 1)
57                 usage();
58
59         (void)dm_init_service(&name);
60         fprintf(stdout, "%s\n", name);
61
62         return(0);
63 }