terminate swap list with NODEV, not 0: 0 is a valid (if unusual) dev
[unix-history] / usr / src / usr.sbin / config / mkswapconf.c
index cf85bbb..21a39ac 100644 (file)
@@ -2,21 +2,11 @@
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)mkswapconf.c       5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)mkswapconf.c       5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -61,8 +51,8 @@ do_swap(fl)
                perror(path(swapname));
                exit(1);
        }
                perror(path(swapname));
                exit(1);
        }
-       fprintf(fp, "#include \"../sys/param.h\"\n");
-       fprintf(fp, "#include \"../sys/conf.h\"\n");
+       fprintf(fp, "#include \"sys/param.h\"\n");
+       fprintf(fp, "#include \"sys/conf.h\"\n");
        fprintf(fp, "\n");
        /*
         * If there aren't any swap devices
        fprintf(fp, "\n");
        /*
         * If there aren't any swap devices
@@ -77,8 +67,6 @@ do_swap(fl)
        }
        fprintf(fp, "dev_t\trootdev = makedev(%d, %d);\n",
                major(fl->f_rootdev), minor(fl->f_rootdev));
        }
        fprintf(fp, "dev_t\trootdev = makedev(%d, %d);\n",
                major(fl->f_rootdev), minor(fl->f_rootdev));
-       fprintf(fp, "dev_t\targdev  = makedev(%d, %d);\n",
-               major(fl->f_argdev), minor(fl->f_argdev));
        fprintf(fp, "dev_t\tdumpdev = makedev(%d, %d);\n",
                major(fl->f_dumpdev), minor(fl->f_dumpdev));
        fprintf(fp, "\n");
        fprintf(fp, "dev_t\tdumpdev = makedev(%d, %d);\n",
                major(fl->f_dumpdev), minor(fl->f_dumpdev));
        fprintf(fp, "\n");
@@ -89,7 +77,7 @@ do_swap(fl)
                    major(dev), minor(dev), swap->f_swapsize, swap->f_fn);
                swap = swap->f_next;
        } while (swap && swap->f_type == SWAPSPEC);
                    major(dev), minor(dev), swap->f_swapsize, swap->f_fn);
                swap = swap->f_next;
        } while (swap && swap->f_type == SWAPSPEC);
-       fprintf(fp, "\t{ 0, 0, 0 }\n");
+       fprintf(fp, "\t{ NODEV, 0, 0 }\n");
        fprintf(fp, "};\n");
        fclose(fp);
        return (swap);
        fprintf(fp, "};\n");
        fclose(fp);
        return (swap);