diff options
author | jkh <jkh@FreeBSD.org> | 1996-07-08 08:54:36 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-07-08 08:54:36 +0000 |
commit | 7e51f09a84728ab85cf82db31aad751f4aca98cb (patch) | |
tree | 412d8ec8d51ea1577e0884b928bfc378d1f29f28 | |
parent | 824afef0c4ffcf3871a0091dfb4fb8af21888b56 (diff) | |
download | FreeBSD-src-7e51f09a84728ab85cf82db31aad751f4aca98cb.zip FreeBSD-src-7e51f09a84728ab85cf82db31aad751f4aca98cb.tar.gz |
Whoops! Now that I'm decompressing docs into /tmp, it's important to
make sure that /tmp is there first! :-) While I'm at it, clean up the
somewhat inexplicably bogus Mkdir() function.
33 files changed, 122 insertions, 119 deletions
diff --git a/release/sysinstall/cdrom.c b/release/sysinstall/cdrom.c index 37ed166..8abd089 100644 --- a/release/sysinstall/cdrom.c +++ b/release/sysinstall/cdrom.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: cdrom.c,v 1.15 1996/06/11 05:06:32 jkh Exp $ + * $Id: cdrom.c,v 1.16 1996/06/14 18:23:26 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -75,7 +75,7 @@ mediaInitCDROM(Device *dev) if (cdromMounted != CD_UNMOUNTED) return TRUE; - if (Mkdir("/cdrom", NULL)) + if (Mkdir("/cdrom")) return FALSE; bzero(&args, sizeof(args)); diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index d8ef40a..69c4849 100644 --- a/release/sysinstall/config.c +++ b/release/sysinstall/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.43 1996/07/04 23:11:54 jkh Exp $ + * $Id: config.c,v 1.44 1996/07/05 08:35:50 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -204,7 +204,7 @@ configFstab(void) for (i = 0; i < nchunks; i++) fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s\t%s %d %d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]), fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i])); - Mkdir("/proc", NULL); + Mkdir("/proc"); fprintf(fstab, "proc\t\t\t\t/proc\t\tprocfs\trw 0 0\n"); /* Now look for the CDROMs */ @@ -213,7 +213,7 @@ configFstab(void) /* Write the first one out as /cdrom */ if (cnt) { - if (Mkdir("/cdrom", NULL)) { + if (Mkdir("/cdrom")) { msgConfirm("Unable to make mount point for: /cdrom"); } else @@ -225,7 +225,7 @@ configFstab(void) char cdname[10]; sprintf(cdname, "/cdrom%d", i); - if (Mkdir(cdname, NULL)) { + if (Mkdir(cdname)) { msgConfirm("Unable to make mount point for: %s", cdname); } else @@ -380,7 +380,7 @@ configResolv(void) "may fail as a result!"); goto skip; } - if (Mkdir("/etc", NULL)) { + if (Mkdir("/etc")) { msgConfirm("Unable to create /etc directory. Network configuration\n" "files will therefore not be written!"); return; @@ -527,7 +527,7 @@ configPorts(dialogMenuItem *self) "as you'll need space to compile any ports."); if (!cp || !*cp) return DITEM_FAILURE; - if (Mkdir(cp, NULL)) + if (Mkdir(cp)) return DITEM_FAILURE; else { if (strcmp(cp, "/usr/ports")) { diff --git a/release/sysinstall/dos.c b/release/sysinstall/dos.c index 9e4ed9b..b1edd3d 100644 --- a/release/sysinstall/dos.c +++ b/release/sysinstall/dos.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: dos.c,v 1.11 1996/04/23 01:29:19 jkh Exp $ + * $Id: dos.c,v 1.12 1996/04/28 03:26:54 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -59,7 +59,7 @@ mediaInitDOS(Device *dev) if (!RunningAsInit || DOSMounted) return TRUE; - if (DITEM_STATUS(Mkdir("/dos", NULL)) != DITEM_SUCCESS) + if (DITEM_STATUS(Mkdir("/dos")) != DITEM_SUCCESS) return FALSE; memset(&args, 0, sizeof(args)); diff --git a/release/sysinstall/floppy.c b/release/sysinstall/floppy.c index a8dc384..ac1b175 100644 --- a/release/sysinstall/floppy.c +++ b/release/sysinstall/floppy.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: floppy.c,v 1.12 1996/05/09 09:42:05 jkh Exp $ + * $Id: floppy.c,v 1.13 1996/07/02 01:03:41 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -121,7 +121,7 @@ mediaInitFloppy(Device *dev) if (floppyMounted) return TRUE; - if (Mkdir("/dist", NULL)) { + if (Mkdir("/dist")) { msgConfirm("Unable to make directory mountpoint for %s!", dev->devname); return FALSE; } diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index 29ac6f5..b08b905 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.107 1996/07/04 23:11:56 jkh Exp $ + * $Id: install.c,v 1.108 1996/07/05 08:35:56 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -225,7 +225,7 @@ installFixitFloppy(dialogMenuItem *self) variable_set2(SYSTEM_STATE, "fixit"); memset(&args, 0, sizeof(args)); args.fspec = "/dev/fd0"; - Mkdir("/mnt2", NULL); + Mkdir("/mnt2"); while (1) { msgConfirm("Please insert a writable fixit floppy and press return"); @@ -241,14 +241,14 @@ installFixitFloppy(dialogMenuItem *self) if (!directory_exists("/tmp")) (void)symlink("/mnt2/tmp", "/tmp"); if (!directory_exists("/var/tmp/vi.recover")) { - if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover", NULL)) != DITEM_SUCCESS) { + if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover")) != DITEM_SUCCESS) { msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n" "vi will kvetch and moan about it as a result but should still\n" "be essentially usable."); } } /* Link the spwd.db file */ - if (DITEM_STATUS(Mkdir("/etc", NULL)) != DITEM_SUCCESS) + if (DITEM_STATUS(Mkdir("/etc")) != DITEM_SUCCESS) msgConfirm("Unable to create an /etc directory! Things are weird on this floppy.."); else if (symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1 && errno != EEXIST) msgConfirm("Couldn't symlink the /etc/spwd.db file! I'm not sure I like this.."); @@ -623,7 +623,7 @@ installFixup(dialogMenuItem *self) chmod("/etc", 0755); /* BOGON #3: No /var/db/mountdtab complains */ - Mkdir("/var/db", NULL); + Mkdir("/var/db"); creat("/var/db/mountdtab", 0644); /* Now run all the mtree stuff to fix things up */ @@ -722,7 +722,7 @@ installFilesystems(dialogMenuItem *self) return DITEM_FAILURE; } if (root->newfs || upgrade) { - Mkdir("/mnt/dev", NULL); + Mkdir("/mnt/dev"); if (!Fake) MakeDevDisk(disk, "/mnt/dev"); } @@ -762,7 +762,7 @@ installFilesystems(dialogMenuItem *self) char name[FILENAME_MAX]; sprintf(name, "/mnt%s", ((PartInfo *)c1->private_data)->mountpoint); - Mkdir(name, NULL); + Mkdir(name); } } } @@ -844,7 +844,7 @@ create_termcap(void) const char **cp; if (!file_readable(TERMCAP_FILE)) { - Mkdir("/usr/share/misc", NULL); + Mkdir("/usr/share/misc"); fp = fopen(TERMCAP_FILE, "w"); if (!fp) { msgConfirm("Unable to initialize termcap file. Some screen-oriented\nutilities may not work."); diff --git a/release/sysinstall/installUpgrade.c b/release/sysinstall/installUpgrade.c index cada516..383a86e 100644 --- a/release/sysinstall/installUpgrade.c +++ b/release/sysinstall/installUpgrade.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: installUpgrade.c,v 1.27 1996/07/02 01:03:43 jkh Exp $ + * $Id: installUpgrade.c,v 1.28 1996/07/05 08:35:57 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -266,7 +266,7 @@ installUpgrade(dialogMenuItem *self) if (extractingBin) { while (!saved_etc) { saved_etc = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?"); - if (!saved_etc || !*saved_etc || Mkdir(saved_etc, NULL)) { + if (!saved_etc || !*saved_etc || Mkdir(saved_etc)) { saved_etc = NULL; if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n" "Doing an upgrade without first backing up your /etc directory is a very\n" diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c index 421eba6..1d6ed97 100644 --- a/release/sysinstall/media.c +++ b/release/sysinstall/media.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: media.c,v 1.44 1996/07/02 01:03:46 jkh Exp $ + * $Id: media.c,v 1.45 1996/07/05 08:35:58 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -412,7 +412,7 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid) if (!dir) dir = "/"; - Mkdir(dir, NULL); + Mkdir(dir); chdir(dir); pipe(pfd); pipe(qfd); @@ -495,7 +495,7 @@ mediaExtractDist(char *dir, int fd) if (!dir) dir = "/"; - Mkdir(dir, NULL); + Mkdir(dir); chdir(dir); pipe(pfd); zpid = fork(); diff --git a/release/sysinstall/misc.c b/release/sysinstall/misc.c index 1c737cb..e4a1360 100644 --- a/release/sysinstall/misc.c +++ b/release/sysinstall/misc.c @@ -1,7 +1,7 @@ /* * Miscellaneous support routines.. * - * $Id: misc.c,v 1.19 1996/06/17 21:48:31 jkh Exp $ + * $Id: misc.c,v 1.20 1996/06/25 18:41:10 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -249,24 +249,24 @@ items_free(dialogMenuItem *list, int *curr, int *max) } int -Mkdir(char *ipath, void *data) +Mkdir(char *ipath) { struct stat sb; - int final=0; + int final; char *p, *path; if (file_readable(ipath) || Fake) return DITEM_SUCCESS; - path = strdup(ipath); + path = strcpy(alloca(strlen(ipath) + 1), ipath); if (isDebug()) msgDebug("mkdir(%s)\n", path); p = path; if (p[0] == '/') /* Skip leading '/'. */ ++p; - for (;!final; ++p) { + for (final = FALSE; !final; ++p) { if (p[0] == '\0' || (p[0] == '/' && p[1] == '\0')) - final++; + final = TRUE; else if (p[0] != '/') continue; *p = '\0'; @@ -284,7 +284,6 @@ Mkdir(char *ipath, void *data) } *p = '/'; } - free(path); return DITEM_SUCCESS; } @@ -308,7 +307,7 @@ Mount(char *mountp, void *dev) } memset(&ufsargs,0,sizeof ufsargs); - if (Mkdir(mountpoint, NULL)) { + if (Mkdir(mountpoint)) { msgConfirm("Unable to make directory mountpoint for %s!", mountpoint); return DITEM_FAILURE; } diff --git a/release/sysinstall/network.c b/release/sysinstall/network.c index 75b8474..b8ac7d6 100644 --- a/release/sysinstall/network.c +++ b/release/sysinstall/network.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: network.c,v 1.12 1996/04/28 20:54:04 jkh Exp $ + * $Id: network.c,v 1.13 1996/06/12 17:09:34 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -175,9 +175,9 @@ startPPP(Device *devp) char myaddr[16], provider[16], speed[16]; /* These are needed to make ppp work */ - Mkdir("/var/log", NULL); - Mkdir("/var/spool/lock", NULL); - Mkdir("/etc/ppp", NULL); + Mkdir("/var/log"); + Mkdir("/var/spool/lock"); + Mkdir("/etc/ppp"); if (!variable_get(VAR_SERIAL_SPEED)) variable_set2(VAR_SERIAL_SPEED, "115200"); diff --git a/release/sysinstall/nfs.c b/release/sysinstall/nfs.c index cd2e963..516e4f1 100644 --- a/release/sysinstall/nfs.c +++ b/release/sysinstall/nfs.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: nfs.c,v 1.8 1996/04/13 13:32:05 jkh Exp $ + * $Id: nfs.c,v 1.9 1996/04/23 01:29:30 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -54,7 +54,7 @@ mediaInitNFS(Device *dev) if (!netDevice->init(netDevice)) return FALSE; - if (Mkdir("/dist", NULL)) + if (Mkdir("/dist")) return FALSE; msgNotify("Mounting %s over NFS.", dev->name); diff --git a/release/sysinstall/package.c b/release/sysinstall/package.c index a0bc1e4..91a8bd2 100644 --- a/release/sysinstall/package.c +++ b/release/sysinstall/package.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: package.c,v 1.39 1996/06/25 04:28:23 jkh Exp $ + * $Id: package.c,v 1.40 1996/06/29 02:22:46 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -104,8 +104,8 @@ package_extract(Device *dev, char *name, Boolean depended) ret = DITEM_SUCCESS | DITEM_RESTORE; /* Make a couple of paranoid locations for temp files to live if user specified none */ if (!variable_get("PKG_TMPDIR")) { - Mkdir("/usr/tmp", NULL); - Mkdir("/var/tmp", NULL); + Mkdir("/usr/tmp"); + Mkdir("/var/tmp"); /* Set it to a location with as much space as possible */ variable_set2("PKG_TMPDIR", "/usr/tmp"); } diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index baa2bf9..1cc22ad 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.70 1996/07/04 23:12:02 jkh Exp $ + * $Id: sysinstall.h,v 1.71 1996/07/05 08:36:00 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -536,7 +536,7 @@ extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, void (*selected)(dialogMenuItem *self, int is_selected), void *data, int aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); -extern int Mkdir(char *, void *data); +extern int Mkdir(char *); extern int Mount(char *, void *data); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w); diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c index 936456b..4dce756 100644 --- a/release/sysinstall/system.c +++ b/release/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.59 1996/05/16 11:47:46 jkh Exp $ + * $Id: system.c,v 1.60 1996/07/05 08:36:02 jkh Exp $ * * Jordan Hubbard * @@ -26,6 +26,7 @@ /* Where we stick our temporary expanded doc file */ +#define DOC_TMP_DIR "/tmp" #define DOC_TMP_FILE "/tmp/doc.tmp" /* @@ -44,6 +45,7 @@ handle_intr(int sig) static char * expand(char *fname) { + Mkdir(DOC_TMP_DIR); unlink(DOC_TMP_FILE); if (vsystem("gzip -c -d %s > %s", fname, DOC_TMP_FILE)) return NULL; diff --git a/release/sysinstall/tape.c b/release/sysinstall/tape.c index 166c786..e611113 100644 --- a/release/sysinstall/tape.c +++ b/release/sysinstall/tape.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: tape.c,v 1.10 1996/04/13 13:32:11 jkh Exp $ + * $Id: tape.c,v 1.11 1996/04/23 01:29:34 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -58,7 +58,7 @@ mediaInitTape(Device *dev) return TRUE; msgDebug("Tape init routine called for %s (private dir is %s)\n", dev->name, dev->private); - Mkdir(dev->private, NULL); + Mkdir(dev->private); if (chdir(dev->private)) return FALSE; /* We know the tape is already in the drive, so go for it */ diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index d8ef40a..69c4849 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.43 1996/07/04 23:11:54 jkh Exp $ + * $Id: config.c,v 1.44 1996/07/05 08:35:50 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -204,7 +204,7 @@ configFstab(void) for (i = 0; i < nchunks; i++) fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s\t%s %d %d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]), fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i])); - Mkdir("/proc", NULL); + Mkdir("/proc"); fprintf(fstab, "proc\t\t\t\t/proc\t\tprocfs\trw 0 0\n"); /* Now look for the CDROMs */ @@ -213,7 +213,7 @@ configFstab(void) /* Write the first one out as /cdrom */ if (cnt) { - if (Mkdir("/cdrom", NULL)) { + if (Mkdir("/cdrom")) { msgConfirm("Unable to make mount point for: /cdrom"); } else @@ -225,7 +225,7 @@ configFstab(void) char cdname[10]; sprintf(cdname, "/cdrom%d", i); - if (Mkdir(cdname, NULL)) { + if (Mkdir(cdname)) { msgConfirm("Unable to make mount point for: %s", cdname); } else @@ -380,7 +380,7 @@ configResolv(void) "may fail as a result!"); goto skip; } - if (Mkdir("/etc", NULL)) { + if (Mkdir("/etc")) { msgConfirm("Unable to create /etc directory. Network configuration\n" "files will therefore not be written!"); return; @@ -527,7 +527,7 @@ configPorts(dialogMenuItem *self) "as you'll need space to compile any ports."); if (!cp || !*cp) return DITEM_FAILURE; - if (Mkdir(cp, NULL)) + if (Mkdir(cp)) return DITEM_FAILURE; else { if (strcmp(cp, "/usr/ports")) { diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 29ac6f5..b08b905 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.107 1996/07/04 23:11:56 jkh Exp $ + * $Id: install.c,v 1.108 1996/07/05 08:35:56 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -225,7 +225,7 @@ installFixitFloppy(dialogMenuItem *self) variable_set2(SYSTEM_STATE, "fixit"); memset(&args, 0, sizeof(args)); args.fspec = "/dev/fd0"; - Mkdir("/mnt2", NULL); + Mkdir("/mnt2"); while (1) { msgConfirm("Please insert a writable fixit floppy and press return"); @@ -241,14 +241,14 @@ installFixitFloppy(dialogMenuItem *self) if (!directory_exists("/tmp")) (void)symlink("/mnt2/tmp", "/tmp"); if (!directory_exists("/var/tmp/vi.recover")) { - if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover", NULL)) != DITEM_SUCCESS) { + if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover")) != DITEM_SUCCESS) { msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n" "vi will kvetch and moan about it as a result but should still\n" "be essentially usable."); } } /* Link the spwd.db file */ - if (DITEM_STATUS(Mkdir("/etc", NULL)) != DITEM_SUCCESS) + if (DITEM_STATUS(Mkdir("/etc")) != DITEM_SUCCESS) msgConfirm("Unable to create an /etc directory! Things are weird on this floppy.."); else if (symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1 && errno != EEXIST) msgConfirm("Couldn't symlink the /etc/spwd.db file! I'm not sure I like this.."); @@ -623,7 +623,7 @@ installFixup(dialogMenuItem *self) chmod("/etc", 0755); /* BOGON #3: No /var/db/mountdtab complains */ - Mkdir("/var/db", NULL); + Mkdir("/var/db"); creat("/var/db/mountdtab", 0644); /* Now run all the mtree stuff to fix things up */ @@ -722,7 +722,7 @@ installFilesystems(dialogMenuItem *self) return DITEM_FAILURE; } if (root->newfs || upgrade) { - Mkdir("/mnt/dev", NULL); + Mkdir("/mnt/dev"); if (!Fake) MakeDevDisk(disk, "/mnt/dev"); } @@ -762,7 +762,7 @@ installFilesystems(dialogMenuItem *self) char name[FILENAME_MAX]; sprintf(name, "/mnt%s", ((PartInfo *)c1->private_data)->mountpoint); - Mkdir(name, NULL); + Mkdir(name); } } } @@ -844,7 +844,7 @@ create_termcap(void) const char **cp; if (!file_readable(TERMCAP_FILE)) { - Mkdir("/usr/share/misc", NULL); + Mkdir("/usr/share/misc"); fp = fopen(TERMCAP_FILE, "w"); if (!fp) { msgConfirm("Unable to initialize termcap file. Some screen-oriented\nutilities may not work."); diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c index 1c737cb..e4a1360 100644 --- a/usr.sbin/sade/misc.c +++ b/usr.sbin/sade/misc.c @@ -1,7 +1,7 @@ /* * Miscellaneous support routines.. * - * $Id: misc.c,v 1.19 1996/06/17 21:48:31 jkh Exp $ + * $Id: misc.c,v 1.20 1996/06/25 18:41:10 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -249,24 +249,24 @@ items_free(dialogMenuItem *list, int *curr, int *max) } int -Mkdir(char *ipath, void *data) +Mkdir(char *ipath) { struct stat sb; - int final=0; + int final; char *p, *path; if (file_readable(ipath) || Fake) return DITEM_SUCCESS; - path = strdup(ipath); + path = strcpy(alloca(strlen(ipath) + 1), ipath); if (isDebug()) msgDebug("mkdir(%s)\n", path); p = path; if (p[0] == '/') /* Skip leading '/'. */ ++p; - for (;!final; ++p) { + for (final = FALSE; !final; ++p) { if (p[0] == '\0' || (p[0] == '/' && p[1] == '\0')) - final++; + final = TRUE; else if (p[0] != '/') continue; *p = '\0'; @@ -284,7 +284,6 @@ Mkdir(char *ipath, void *data) } *p = '/'; } - free(path); return DITEM_SUCCESS; } @@ -308,7 +307,7 @@ Mount(char *mountp, void *dev) } memset(&ufsargs,0,sizeof ufsargs); - if (Mkdir(mountpoint, NULL)) { + if (Mkdir(mountpoint)) { msgConfirm("Unable to make directory mountpoint for %s!", mountpoint); return DITEM_FAILURE; } diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index baa2bf9..1cc22ad 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.70 1996/07/04 23:12:02 jkh Exp $ + * $Id: sysinstall.h,v 1.71 1996/07/05 08:36:00 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -536,7 +536,7 @@ extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, void (*selected)(dialogMenuItem *self, int is_selected), void *data, int aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); -extern int Mkdir(char *, void *data); +extern int Mkdir(char *); extern int Mount(char *, void *data); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w); diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index 936456b..4dce756 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.59 1996/05/16 11:47:46 jkh Exp $ + * $Id: system.c,v 1.60 1996/07/05 08:36:02 jkh Exp $ * * Jordan Hubbard * @@ -26,6 +26,7 @@ /* Where we stick our temporary expanded doc file */ +#define DOC_TMP_DIR "/tmp" #define DOC_TMP_FILE "/tmp/doc.tmp" /* @@ -44,6 +45,7 @@ handle_intr(int sig) static char * expand(char *fname) { + Mkdir(DOC_TMP_DIR); unlink(DOC_TMP_FILE); if (vsystem("gzip -c -d %s > %s", fname, DOC_TMP_FILE)) return NULL; diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c index 37ed166..8abd089 100644 --- a/usr.sbin/sysinstall/cdrom.c +++ b/usr.sbin/sysinstall/cdrom.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: cdrom.c,v 1.15 1996/06/11 05:06:32 jkh Exp $ + * $Id: cdrom.c,v 1.16 1996/06/14 18:23:26 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -75,7 +75,7 @@ mediaInitCDROM(Device *dev) if (cdromMounted != CD_UNMOUNTED) return TRUE; - if (Mkdir("/cdrom", NULL)) + if (Mkdir("/cdrom")) return FALSE; bzero(&args, sizeof(args)); diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index d8ef40a..69c4849 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.43 1996/07/04 23:11:54 jkh Exp $ + * $Id: config.c,v 1.44 1996/07/05 08:35:50 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -204,7 +204,7 @@ configFstab(void) for (i = 0; i < nchunks; i++) fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s\t%s %d %d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]), fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i])); - Mkdir("/proc", NULL); + Mkdir("/proc"); fprintf(fstab, "proc\t\t\t\t/proc\t\tprocfs\trw 0 0\n"); /* Now look for the CDROMs */ @@ -213,7 +213,7 @@ configFstab(void) /* Write the first one out as /cdrom */ if (cnt) { - if (Mkdir("/cdrom", NULL)) { + if (Mkdir("/cdrom")) { msgConfirm("Unable to make mount point for: /cdrom"); } else @@ -225,7 +225,7 @@ configFstab(void) char cdname[10]; sprintf(cdname, "/cdrom%d", i); - if (Mkdir(cdname, NULL)) { + if (Mkdir(cdname)) { msgConfirm("Unable to make mount point for: %s", cdname); } else @@ -380,7 +380,7 @@ configResolv(void) "may fail as a result!"); goto skip; } - if (Mkdir("/etc", NULL)) { + if (Mkdir("/etc")) { msgConfirm("Unable to create /etc directory. Network configuration\n" "files will therefore not be written!"); return; @@ -527,7 +527,7 @@ configPorts(dialogMenuItem *self) "as you'll need space to compile any ports."); if (!cp || !*cp) return DITEM_FAILURE; - if (Mkdir(cp, NULL)) + if (Mkdir(cp)) return DITEM_FAILURE; else { if (strcmp(cp, "/usr/ports")) { diff --git a/usr.sbin/sysinstall/dos.c b/usr.sbin/sysinstall/dos.c index 9e4ed9b..b1edd3d 100644 --- a/usr.sbin/sysinstall/dos.c +++ b/usr.sbin/sysinstall/dos.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: dos.c,v 1.11 1996/04/23 01:29:19 jkh Exp $ + * $Id: dos.c,v 1.12 1996/04/28 03:26:54 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -59,7 +59,7 @@ mediaInitDOS(Device *dev) if (!RunningAsInit || DOSMounted) return TRUE; - if (DITEM_STATUS(Mkdir("/dos", NULL)) != DITEM_SUCCESS) + if (DITEM_STATUS(Mkdir("/dos")) != DITEM_SUCCESS) return FALSE; memset(&args, 0, sizeof(args)); diff --git a/usr.sbin/sysinstall/floppy.c b/usr.sbin/sysinstall/floppy.c index a8dc384..ac1b175 100644 --- a/usr.sbin/sysinstall/floppy.c +++ b/usr.sbin/sysinstall/floppy.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: floppy.c,v 1.12 1996/05/09 09:42:05 jkh Exp $ + * $Id: floppy.c,v 1.13 1996/07/02 01:03:41 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -121,7 +121,7 @@ mediaInitFloppy(Device *dev) if (floppyMounted) return TRUE; - if (Mkdir("/dist", NULL)) { + if (Mkdir("/dist")) { msgConfirm("Unable to make directory mountpoint for %s!", dev->devname); return FALSE; } diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 29ac6f5..b08b905 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.107 1996/07/04 23:11:56 jkh Exp $ + * $Id: install.c,v 1.108 1996/07/05 08:35:56 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -225,7 +225,7 @@ installFixitFloppy(dialogMenuItem *self) variable_set2(SYSTEM_STATE, "fixit"); memset(&args, 0, sizeof(args)); args.fspec = "/dev/fd0"; - Mkdir("/mnt2", NULL); + Mkdir("/mnt2"); while (1) { msgConfirm("Please insert a writable fixit floppy and press return"); @@ -241,14 +241,14 @@ installFixitFloppy(dialogMenuItem *self) if (!directory_exists("/tmp")) (void)symlink("/mnt2/tmp", "/tmp"); if (!directory_exists("/var/tmp/vi.recover")) { - if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover", NULL)) != DITEM_SUCCESS) { + if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover")) != DITEM_SUCCESS) { msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n" "vi will kvetch and moan about it as a result but should still\n" "be essentially usable."); } } /* Link the spwd.db file */ - if (DITEM_STATUS(Mkdir("/etc", NULL)) != DITEM_SUCCESS) + if (DITEM_STATUS(Mkdir("/etc")) != DITEM_SUCCESS) msgConfirm("Unable to create an /etc directory! Things are weird on this floppy.."); else if (symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1 && errno != EEXIST) msgConfirm("Couldn't symlink the /etc/spwd.db file! I'm not sure I like this.."); @@ -623,7 +623,7 @@ installFixup(dialogMenuItem *self) chmod("/etc", 0755); /* BOGON #3: No /var/db/mountdtab complains */ - Mkdir("/var/db", NULL); + Mkdir("/var/db"); creat("/var/db/mountdtab", 0644); /* Now run all the mtree stuff to fix things up */ @@ -722,7 +722,7 @@ installFilesystems(dialogMenuItem *self) return DITEM_FAILURE; } if (root->newfs || upgrade) { - Mkdir("/mnt/dev", NULL); + Mkdir("/mnt/dev"); if (!Fake) MakeDevDisk(disk, "/mnt/dev"); } @@ -762,7 +762,7 @@ installFilesystems(dialogMenuItem *self) char name[FILENAME_MAX]; sprintf(name, "/mnt%s", ((PartInfo *)c1->private_data)->mountpoint); - Mkdir(name, NULL); + Mkdir(name); } } } @@ -844,7 +844,7 @@ create_termcap(void) const char **cp; if (!file_readable(TERMCAP_FILE)) { - Mkdir("/usr/share/misc", NULL); + Mkdir("/usr/share/misc"); fp = fopen(TERMCAP_FILE, "w"); if (!fp) { msgConfirm("Unable to initialize termcap file. Some screen-oriented\nutilities may not work."); diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index cada516..383a86e 100644 --- a/usr.sbin/sysinstall/installUpgrade.c +++ b/usr.sbin/sysinstall/installUpgrade.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: installUpgrade.c,v 1.27 1996/07/02 01:03:43 jkh Exp $ + * $Id: installUpgrade.c,v 1.28 1996/07/05 08:35:57 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -266,7 +266,7 @@ installUpgrade(dialogMenuItem *self) if (extractingBin) { while (!saved_etc) { saved_etc = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?"); - if (!saved_etc || !*saved_etc || Mkdir(saved_etc, NULL)) { + if (!saved_etc || !*saved_etc || Mkdir(saved_etc)) { saved_etc = NULL; if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n" "Doing an upgrade without first backing up your /etc directory is a very\n" diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 421eba6..1d6ed97 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: media.c,v 1.44 1996/07/02 01:03:46 jkh Exp $ + * $Id: media.c,v 1.45 1996/07/05 08:35:58 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -412,7 +412,7 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid) if (!dir) dir = "/"; - Mkdir(dir, NULL); + Mkdir(dir); chdir(dir); pipe(pfd); pipe(qfd); @@ -495,7 +495,7 @@ mediaExtractDist(char *dir, int fd) if (!dir) dir = "/"; - Mkdir(dir, NULL); + Mkdir(dir); chdir(dir); pipe(pfd); zpid = fork(); diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c index 1c737cb..e4a1360 100644 --- a/usr.sbin/sysinstall/misc.c +++ b/usr.sbin/sysinstall/misc.c @@ -1,7 +1,7 @@ /* * Miscellaneous support routines.. * - * $Id: misc.c,v 1.19 1996/06/17 21:48:31 jkh Exp $ + * $Id: misc.c,v 1.20 1996/06/25 18:41:10 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -249,24 +249,24 @@ items_free(dialogMenuItem *list, int *curr, int *max) } int -Mkdir(char *ipath, void *data) +Mkdir(char *ipath) { struct stat sb; - int final=0; + int final; char *p, *path; if (file_readable(ipath) || Fake) return DITEM_SUCCESS; - path = strdup(ipath); + path = strcpy(alloca(strlen(ipath) + 1), ipath); if (isDebug()) msgDebug("mkdir(%s)\n", path); p = path; if (p[0] == '/') /* Skip leading '/'. */ ++p; - for (;!final; ++p) { + for (final = FALSE; !final; ++p) { if (p[0] == '\0' || (p[0] == '/' && p[1] == '\0')) - final++; + final = TRUE; else if (p[0] != '/') continue; *p = '\0'; @@ -284,7 +284,6 @@ Mkdir(char *ipath, void *data) } *p = '/'; } - free(path); return DITEM_SUCCESS; } @@ -308,7 +307,7 @@ Mount(char *mountp, void *dev) } memset(&ufsargs,0,sizeof ufsargs); - if (Mkdir(mountpoint, NULL)) { + if (Mkdir(mountpoint)) { msgConfirm("Unable to make directory mountpoint for %s!", mountpoint); return DITEM_FAILURE; } diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c index 75b8474..b8ac7d6 100644 --- a/usr.sbin/sysinstall/network.c +++ b/usr.sbin/sysinstall/network.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: network.c,v 1.12 1996/04/28 20:54:04 jkh Exp $ + * $Id: network.c,v 1.13 1996/06/12 17:09:34 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -175,9 +175,9 @@ startPPP(Device *devp) char myaddr[16], provider[16], speed[16]; /* These are needed to make ppp work */ - Mkdir("/var/log", NULL); - Mkdir("/var/spool/lock", NULL); - Mkdir("/etc/ppp", NULL); + Mkdir("/var/log"); + Mkdir("/var/spool/lock"); + Mkdir("/etc/ppp"); if (!variable_get(VAR_SERIAL_SPEED)) variable_set2(VAR_SERIAL_SPEED, "115200"); diff --git a/usr.sbin/sysinstall/nfs.c b/usr.sbin/sysinstall/nfs.c index cd2e963..516e4f1 100644 --- a/usr.sbin/sysinstall/nfs.c +++ b/usr.sbin/sysinstall/nfs.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: nfs.c,v 1.8 1996/04/13 13:32:05 jkh Exp $ + * $Id: nfs.c,v 1.9 1996/04/23 01:29:30 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -54,7 +54,7 @@ mediaInitNFS(Device *dev) if (!netDevice->init(netDevice)) return FALSE; - if (Mkdir("/dist", NULL)) + if (Mkdir("/dist")) return FALSE; msgNotify("Mounting %s over NFS.", dev->name); diff --git a/usr.sbin/sysinstall/package.c b/usr.sbin/sysinstall/package.c index a0bc1e4..91a8bd2 100644 --- a/usr.sbin/sysinstall/package.c +++ b/usr.sbin/sysinstall/package.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: package.c,v 1.39 1996/06/25 04:28:23 jkh Exp $ + * $Id: package.c,v 1.40 1996/06/29 02:22:46 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -104,8 +104,8 @@ package_extract(Device *dev, char *name, Boolean depended) ret = DITEM_SUCCESS | DITEM_RESTORE; /* Make a couple of paranoid locations for temp files to live if user specified none */ if (!variable_get("PKG_TMPDIR")) { - Mkdir("/usr/tmp", NULL); - Mkdir("/var/tmp", NULL); + Mkdir("/usr/tmp"); + Mkdir("/var/tmp"); /* Set it to a location with as much space as possible */ variable_set2("PKG_TMPDIR", "/usr/tmp"); } diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index baa2bf9..1cc22ad 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.70 1996/07/04 23:12:02 jkh Exp $ + * $Id: sysinstall.h,v 1.71 1996/07/05 08:36:00 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -536,7 +536,7 @@ extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, void (*selected)(dialogMenuItem *self, int is_selected), void *data, int aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); -extern int Mkdir(char *, void *data); +extern int Mkdir(char *); extern int Mount(char *, void *data); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w); diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index 936456b..4dce756 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.59 1996/05/16 11:47:46 jkh Exp $ + * $Id: system.c,v 1.60 1996/07/05 08:36:02 jkh Exp $ * * Jordan Hubbard * @@ -26,6 +26,7 @@ /* Where we stick our temporary expanded doc file */ +#define DOC_TMP_DIR "/tmp" #define DOC_TMP_FILE "/tmp/doc.tmp" /* @@ -44,6 +45,7 @@ handle_intr(int sig) static char * expand(char *fname) { + Mkdir(DOC_TMP_DIR); unlink(DOC_TMP_FILE); if (vsystem("gzip -c -d %s > %s", fname, DOC_TMP_FILE)) return NULL; diff --git a/usr.sbin/sysinstall/tape.c b/usr.sbin/sysinstall/tape.c index 166c786..e611113 100644 --- a/usr.sbin/sysinstall/tape.c +++ b/usr.sbin/sysinstall/tape.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: tape.c,v 1.10 1996/04/13 13:32:11 jkh Exp $ + * $Id: tape.c,v 1.11 1996/04/23 01:29:34 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -58,7 +58,7 @@ mediaInitTape(Device *dev) return TRUE; msgDebug("Tape init routine called for %s (private dir is %s)\n", dev->name, dev->private); - Mkdir(dev->private, NULL); + Mkdir(dev->private); if (chdir(dev->private)) return FALSE; /* We know the tape is already in the drive, so go for it */ |