summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1997-09-16 10:14:23 +0000
committerjkh <jkh@FreeBSD.org>1997-09-16 10:14:23 +0000
commitd387f3a0a99b84c361775c58a44002ed3511c815 (patch)
tree0a3cae00e9faa8ad5df5d833845a3dbf728e63b4 /usr.sbin/sade
parent1bd32b987b7336e1c1c99ba6a70f36b84af119ed (diff)
downloadFreeBSD-src-d387f3a0a99b84c361775c58a44002ed3511c815.zip
FreeBSD-src-d387f3a0a99b84c361775c58a44002ed3511c815.tar.gz
MF22: pst's changes.
Submitted by: pst
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r--usr.sbin/sade/label.c38
-rw-r--r--usr.sbin/sade/termcap.c13
2 files changed, 28 insertions, 23 deletions
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c
index 0e745ed..161560d 100644
--- a/usr.sbin/sade/label.c
+++ b/usr.sbin/sade/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: label.c,v 1.72 1997/08/11 13:08:26 jkh Exp $
+ * $Id: label.c,v 1.73 1997/09/09 16:32:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -756,25 +756,27 @@ diskLabel(char *str)
sz = atoi(cp) * ONE_MEG;
else
sz = space_free(label_chunk_info[here].c);
- if (!sz || sz < (USR_MIN_SIZE * ONE_MEG)) {
- msgConfirm("Less than %dMB free for /usr - you will need to\n"
- "partition your disk manually with a custom install!", USR_MIN_SIZE);
- clear_wins();
- break;
- }
+ if (sz) {
+ if (sz < (USR_MIN_SIZE * ONE_MEG)) {
+ msgConfirm("Less than %dMB free for /usr - you will need to\n"
+ "partition your disk manually with a custom install!", USR_MIN_SIZE);
+ clear_wins();
+ break;
+ }
- tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
- label_chunk_info[here].c,
- sz, part, FS_BSDFFS, 0);
- if (!tmp) {
- msgConfirm("Unable to create the /usr partition. Not enough space?\n"
- "You will need to partition your disk manually with a custom install!");
- clear_wins();
- break;
+ tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
+ label_chunk_info[here].c,
+ sz, part, FS_BSDFFS, 0);
+ if (!tmp) {
+ msgConfirm("Unable to create the /usr partition. Not enough space?\n"
+ "You will need to partition your disk manually with a custom install!");
+ clear_wins();
+ break;
+ }
+ tmp->private_data = new_part("/usr", TRUE, tmp->size);
+ tmp->private_free = safe_free;
+ record_label_chunks(devs);
}
- tmp->private_data = new_part("/usr", TRUE, tmp->size);
- tmp->private_free = safe_free;
- record_label_chunks(devs);
}
/* At this point, we're reasonably "labelled" */
if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written")))
diff --git a/usr.sbin/sade/termcap.c b/usr.sbin/sade/termcap.c
index fa9c19f..1569479 100644
--- a/usr.sbin/sade/termcap.c
+++ b/usr.sbin/sade/termcap.c
@@ -94,17 +94,20 @@ set_termcap(void)
if (setenv("TERMCAP", termcap, 1) < 0)
return -1;
}
- if (DebugFD == -1)
- DebugFD = dup(1);
+ if (DebugFD < 0)
+ DebugFD = open("/dev/null", O_RDWR, 0);
}
else {
int i, on;
if (getpid() == 1) {
DebugFD = open("/dev/ttyv1", O_WRONLY);
- on = 1;
- i = ioctl(DebugFD, TIOCCONS, (char *)&on);
- msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno));
+ if (DebugFD != -1) {
+ on = 1;
+ i = ioctl(DebugFD, TIOCCONS, (char *)&on);
+ msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n",
+ DebugFD, i, !i ? "success" : strerror(errno));
+ }
}
if (ColorDisplay) {
if (!term) {
OpenPOWER on IntegriCloud