1 #ifndef GO32 2 #include <stdio.h> 3 #include <unistd.h> 4 #include <stdlib.h> 5 #include <sys/mount.h> 6 #ifndef GLIBC2 7 #include <linux/fs.h> 8 #endif 9 #include "version.h" 10 #include "umount.h" 11 12 extern char *optarg; 13 extern int optind, opterr, optopt; 14 15 int umount_main (int argc, char **argv) { 16 char *option_fstype=NULL; 17 char option_umountall=0; 18 char option_verbose=0; 19 char ch; 20 21 while ( (ch=getopt(argc,argv,"VafFrvwt:o:")) != -1 ) { 22 switch (ch) { 23 case 'a': 24 /* TODO: Make the umountall option work */ 25 option_umountall=1; 26 break; 27 case 'v': 28 /* TODO: Make the Verbose option work */ 29 option_verbose=1; 30 break; 31 case 't': 32 /* TODO: Make the fstype option work, depends on umountall option*/ 33 34 option_fstype=optarg; 35 break; 36 case 'V': 37 write(STDOUT_FILENO, "umount: mooselinux-" MOOSE_VERSION "\n", 19+sizeof(MOOSE_VERSION)); 38 return(0); 39 default: 40 return(-1); 41 } 42 } 43 44 if ((argc-optind)==0) { 45 return(-1); 46 } 47 48 49 if (umount(argv[optind])<0) { 50 perror("umount"); 51 } 52 return(0); 53 } 54 #else 55 int umount_main (int argc, char **argv) { 56 return(0); 57 } 58 #endif |