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.
This commit is contained in:
Jordan K. Hubbard 1996-07-08 08:54:36 +00:00
parent 502ba6e4a8
commit cf1647cd2f
33 changed files with 122 additions and 119 deletions

View file

@ -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));

View file

@ -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")) {

View file

@ -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));

View file

@ -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;
}

View file

@ -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.");

View file

@ -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"

View file

@ -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();

View file

@ -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;
}

View file

@ -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");

View file

@ -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);

View file

@ -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");
}

View file

@ -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);

View file

@ -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;

View file

@ -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 */

View file

@ -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")) {

View file

@ -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.");

View file

@ -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;
}

View file

@ -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);

View file

@ -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;

View file

@ -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));

View file

@ -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")) {

View file

@ -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));

View file

@ -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;
}

View file

@ -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.");

View file

@ -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"

View file

@ -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();

View file

@ -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;
}

View file

@ -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");

View file

@ -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);

View file

@ -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");
}

View file

@ -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);

View file

@ -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;

View file

@ -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 */