]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/lockd/lockd.c
2001-01-25 H.J. Lu <hjl@lucon.org>
[nfs-utils.git] / utils / lockd / lockd.c
1 /*
2  * lockd
3  *
4  * This is the user level part of lockd. This is very primitive, because
5  * all the work is now done in the kernel module.
6  *
7  */
8
9 #include "config.h"
10
11 #include <stdio.h>
12 #include <errno.h>
13 #include "nfslib.h"
14
15 static void     usage(const char *);
16
17 int
18 main(int argc, char **argv)
19 {
20         int error;
21
22         if (argc > 1)
23                 usage (argv [0]);
24
25         if ((error = lockdsvc()) < 0) {
26                 if (errno == EINVAL)
27                         /* Ignore EINVAL since kernel may start
28                            lockd automatically. */
29                         error = 0;
30                 else
31                         perror("lockdsvc");
32         }
33
34         return (error != 0);
35 }
36
37 static void
38 usage(const char *prog)
39 {
40         fprintf(stderr, "usage:\n%s\n", prog);
41         exit(2);
42 }