date and time created 83/08/11 20:49:40 by sam
[unix-history] / usr / src / old / rxformat / rxformat.c
index 2e5d163..43d0cb6 100644 (file)
@@ -1,13 +1,16 @@
-/*     rxformat.c      4.2     83/04/28        */
+/*     rxformat.c      4.4     83/06/02        */
 
 #include <stdio.h>
 #include <sys/file.h>
 #include <errno.h>
 
 #include <stdio.h>
 #include <sys/file.h>
 #include <errno.h>
-#include "/sys/vaxuba/rxreg.h"
+#include <vaxuba/rxreg.h>
+
+char devname[] = "/dev/rrx?a";
 
 /*
 
 /*
- * format floppy disks on RX02
+ * Format RX02 floppy disks.
  */
  */
+
 main(argc, argv)
        int argc;
        char *argv[];
 main(argc, argv)
        int argc;
        char *argv[];
@@ -20,21 +23,26 @@ main(argc, argv)
                if (strncmp(argv[1],"-d",2) != 0)
                        usage();
                idens++;
                if (strncmp(argv[1],"-d",2) != 0)
                        usage();
                idens++;
-               filarg = 2;
+               filarg++;
        }
        }
-       if ((fd = open(argv[filarg], FRDWR, 0666)) < NULL) {
-               perror(argv[filarg]);
+       devname[8] = argv[filarg][7];
+       if ((fd = open(devname, O_RDWR)) < NULL) {
+               perror(devname);
                exit (0);
        }
                exit (0);
        }
-       printf("Format %s to", *(argv[filarg]));
+       printf("Format %s to", argv[filarg]);
        if (idens)
                printf(" double density (y/n) ?");
        else
                printf(" single density (y/n) ?");
        if (getchar() != 'y')
                exit (0);
        if (idens)
                printf(" double density (y/n) ?");
        else
                printf(" single density (y/n) ?");
        if (getchar() != 'y')
                exit (0);
+       /* 
+        * Change the ioctl command when dkio.h has
+        * been finished.
+        */
        if (ioctl(fd, RXIOC_FORMAT, &idens) != NULL)
        if (ioctl(fd, RXIOC_FORMAT, &idens) != NULL)
-               perror(argv[2]);
+               perror(devname);
        close (fd);
 }
 
        close (fd);
 }