Magellan Linux

Diff of /trunk/mkinitrd-magellan/klibc/usr/utils/mount_main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 814 by niro, Sat Sep 1 22:45:15 2007 UTC revision 815 by niro, Fri Apr 24 18:32:46 2009 UTC
# Line 22  do_mount(char *dev, char *dir, char *typ Line 22  do_mount(char *dev, char *dir, char *typ
22   int error = 0;   int error = 0;
23    
24   while ((s = strsep(&type, ",")) != NULL) {   while ((s = strsep(&type, ",")) != NULL) {
25        retry:  retry:
26   if (mount(dev, dir, s, rwflag, data) == -1) {   if (mount(dev, dir, s, rwflag, data) == -1) {
27   error = errno;   error = errno;
28   /*   /*
# Line 42  do_mount(char *dev, char *dir, char *typ Line 42  do_mount(char *dev, char *dir, char *typ
42   rwflag |= MS_RDONLY;   rwflag |= MS_RDONLY;
43   goto retry;   goto retry;
44   }   }
45   break;   } else {
46     error = 0;
47   }   }
48     break;
49   }   }
50    
51   if (error) {   if (error) {
# Line 64  int main(int argc, char *argv[]) Line 66  int main(int argc, char *argv[])
66   rwflag = MS_VERBOSE;   rwflag = MS_VERBOSE;
67    
68   do {   do {
69   c = getopt(argc, argv, "o:rt:w");   c = getopt(argc, argv, "no:rt:wfi");
70   if (c == EOF)   if (c == EOF)
71   break;   break;
72   switch (c) {   switch (c) {
73     case 'n':
74     /* no mtab writing */
75     break;
76   case 'o':   case 'o':
77   rwflag = parse_mount_options(optarg, rwflag, &extra);   rwflag = parse_mount_options(optarg, rwflag, &extra);
78   break;   break;
# Line 80  int main(int argc, char *argv[]) Line 85  int main(int argc, char *argv[])
85   case 'w':   case 'w':
86   rwflag &= ~MS_RDONLY;   rwflag &= ~MS_RDONLY;
87   break;   break;
88     case 'f':
89     /* we can't edit /etc/mtab yet anyway; exit */
90     exit(0);
91     case 'i':
92     /* ignore for now; no support for mount helpers */
93     break;
94   case '?':   case '?':
95   fprintf(stderr, "%s: invalid option -%c\n",   fprintf(stderr, "%s: invalid option -%c\n",
96   progname, optopt);   progname, optopt);
# Line 95  int main(int argc, char *argv[]) Line 106  int main(int argc, char *argv[])
106   type = "none";   type = "none";
107    
108   if (optind + 2 != argc || type == NULL) {   if (optind + 2 != argc || type == NULL) {
109   fprintf(stderr, "Usage: %s [-r] [-w] [-o options] [-t type] "   fprintf(stderr, "Usage: %s [-r] [-w] [-o options] [-t type] [-f] [-i] "
110   "device directory\n", progname);   "[-n] device directory\n", progname);
111   exit(1);   exit(1);
112   }   }
113    

Legend:
Removed from v.814  
changed lines
  Added in v.815