checkpoint for 4.4Alpha
[unix-history] / usr / src / sbin / tunefs / tunefs.c
index 44e1379..7f8d427 100644 (file)
@@ -1,30 +1,29 @@
 /*
 /*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1983 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
 char copyright[] =
  */
 
 #ifndef lint
 char copyright[] =
-"@(#) Copyright (c) 1983 Regents of the University of California.\n\
+"@(#) Copyright (c) 1983 The Regents of the University of California.\n\
  All rights reserved.\n";
  All rights reserved.\n";
-#endif not lint
+#endif /* not lint */
 
 #ifndef lint
 
 #ifndef lint
-static char sccsid[] = "@(#)tunefs.c   5.4 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)tunefs.c   5.12 (Berkeley) %G%";
+#endif /* not lint */
 
 /*
  * tunefs: change layout parameters to an existing file system.
  */
 
 /*
  * tunefs: change layout parameters to an existing file system.
  */
-
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/param.h>
 #include <sys/stat.h>
-#include <sys/fs.h>
-#include <sys/inode.h>
-
-#include <stdio.h>
+#include <ufs/ffs/fs.h>
 #include <fstab.h>
 #include <fstab.h>
+#include <stdio.h>
+#include <paths.h>
 
 union {
        struct  fs sb;
 
 union {
        struct  fs sb;
@@ -45,7 +44,6 @@ main(argc, argv)
        int Aflag = 0;
        struct fstab *fs;
        char *chg[2], device[MAXPATHLEN];
        int Aflag = 0;
        struct fstab *fs;
        char *chg[2], device[MAXPATHLEN];
-       extern char *sprintf();
 
        argc--, argv++; 
        if (argc < 2)
 
        argc--, argv++; 
        if (argc < 2)
@@ -59,7 +57,8 @@ again:
                if (*special != '/') {
                        if (*special == 'r')
                                special++;
                if (*special != '/') {
                        if (*special == 'r')
                                special++;
-                       special = sprintf(device, "/dev/%s", special);
+                       (void)sprintf(device, "%s/%s", _PATH_DEV, special);
+                       special = device;
                        goto again;
                }
                fprintf(stderr, "tunefs: "); perror(special);
                        goto again;
                }
                fprintf(stderr, "tunefs: "); perror(special);
@@ -98,8 +97,6 @@ again:
                                        fatal("-d: missing %s", name);
                                argc--, argv++;
                                i = atoi(*argv);
                                        fatal("-d: missing %s", name);
                                argc--, argv++;
                                i = atoi(*argv);
-                               if (i < 0)
-                                       fatal("%s: bad %s", *argv, name);
                                fprintf(stdout,
                                        "%s changes from %dms to %dms\n",
                                        name, sblock.fs_rotdelay, i);
                                fprintf(stdout,
                                        "%s changes from %dms to %dms\n",
                                        name, sblock.fs_rotdelay, i);