diff options
author | phk <phk@FreeBSD.org> | 1995-05-21 03:20:05 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-05-21 03:20:05 +0000 |
commit | bba1428e2f8f96fb77f4e38ec7f30959e9450421 (patch) | |
tree | 171db5ac56bc9fcd4c6e1f27bbb2757d9390a7d0 /usr.sbin/sade/label.c | |
parent | b5bcdbe42d1517e353cf09a0d1a8f71dee1e0129 (diff) | |
download | FreeBSD-src-bba1428e2f8f96fb77f4e38ec7f30959e9450421.zip FreeBSD-src-bba1428e2f8f96fb77f4e38ec7f30959e9450421.tar.gz |
Make a fixit.flp target too.
Improve the search code for the -u # argument to newfs.
Diffstat (limited to 'usr.sbin/sade/label.c')
-rw-r--r-- | usr.sbin/sade/label.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index bd45853..68db110 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.12 1995/05/20 19:22:21 jkh Exp $ + * $Id: label.c,v 1.13 1995/05/21 01:56:02 phk Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -181,17 +181,21 @@ static PartInfo * new_part(char *mpoint, Boolean newfs, u_long size) { PartInfo *ret; - u_long divisor; + u_long target,divisor; ret = (PartInfo *)safe_malloc(sizeof(PartInfo)); strncpy(ret->mountpoint, mpoint, FILENAME_MAX); strcpy(ret->newfs_cmd, "newfs"); - for(divisor = 4096 ; divisor > 17*4 ; divisor--) { - if (!(size % divisor)) { - sprintf(ret->newfs_cmd+strlen(ret->newfs_cmd)," -u %ld",divisor); + ret->newfs = newfs; + for(target = size; target; target--) { + for(divisor = 4096 ; divisor > 1023; divisor--) { + if (!(target % divisor)) { + sprintf(ret->newfs_cmd+strlen(ret->newfs_cmd), + " -u %ld",divisor); + return ret; + } } } - ret->newfs = newfs; return ret; } |