Very small patch from Julian Elischer to make the ultra14f.c driver work
[unix-history] / sbin / mount_pcfs / mount_pcfs.c
CommitLineData
15637ed4
RG
1/*
2 * 06 Apr 93, Rodney W. Grimes, changed MOUNT_PCFS to MOUNT_MSDOS, whole
3 * thing should be renamed msdosfs...
4 *
5 * No copyright as supplied to the patchkit???
6 * Who wrote this???
7 *
8 */
9#include <stdio.h>
10#include <sys/types.h>
11#include <sys/mount.h>
12
13char *progname;
14
15void
16usage ()
17{
18 fprintf (stderr, "usage: %s bdev dir\n", progname);
19 exit (1);
20}
21
22int
23main (argc, argv)
24int argc;
25char **argv;
26{
27 char *dev;
28 char *dir;
29 struct pcfs_args args;
30 int c;
31 extern char *optarg;
32 extern int optind;
33 int opts;
34
35 progname = argv[0];
36
37 opts = 0;
38
39 while ((c = getopt (argc, argv, "F:")) != EOF) {
40 switch (c) {
41 case 'F':
42 opts |= atoi (optarg);
43 break;
44 default:
45 usage ();
46 }
47 }
48
49 if (optind + 2 != argc)
50 usage ();
51
52 dev = argv[optind];
53 dir = argv[optind + 1];
54
55 args.fspec = dev;
56 args.exflags = 0;
57 args.exroot = 0;
58
59 if (mount (MOUNT_MSDOS, dir, opts, &args) < 0) {
60 perror ("mount");
61 exit (1);
62 }
63
64 exit (0);
65}