Finished (?) merging with Lite2: cleaned up #include mess.
Fixed style bugs in FreeBSD changes.
This commit is contained in:
parent
a2c6443276
commit
bb19997c02
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23798
@ -42,8 +42,6 @@ static const char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
|
|||||||
#include <ufs/ufs/dir.h>
|
#include <ufs/ufs/dir.h>
|
||||||
#include <ufs/ffs/fs.h>
|
#include <ufs/ffs/fs.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -168,7 +166,8 @@ checkinode(inumber, idesc)
|
|||||||
* Fake ndb value so direct/indirect block checks below
|
* Fake ndb value so direct/indirect block checks below
|
||||||
* will detect any garbage after symlink string.
|
* will detect any garbage after symlink string.
|
||||||
*/
|
*/
|
||||||
if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) {
|
if (dp->di_size < sblock.fs_maxsymlinklen ||
|
||||||
|
dp->di_blocks == 0) {
|
||||||
ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
|
ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
|
||||||
if (ndb > NDADDR) {
|
if (ndb > NDADDR) {
|
||||||
j = ndb - NDADDR;
|
j = ndb - NDADDR;
|
||||||
|
@ -38,13 +38,12 @@ static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include <ufs/ufs/dinode.h>
|
#include <ufs/ufs/dinode.h>
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <fstab.h>
|
#include <fstab.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "fsck.h"
|
#include "fsck.h"
|
||||||
|
|
||||||
@ -124,8 +123,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
maxrun = ndisks;
|
maxrun = ndisks;
|
||||||
nextdisk = disks;
|
nextdisk = disks;
|
||||||
for (passno = 0; passno < maxrun; ++passno) {
|
for (passno = 0; passno < maxrun; ++passno) {
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
while ((ret = startdisk(nextdisk, chkit)) && nrun > 0)
|
||||||
nrun > 0)
|
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -164,8 +162,8 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
|
|
||||||
if (nextdisk == NULL) {
|
if (nextdisk == NULL) {
|
||||||
if (dk->part) {
|
if (dk->part) {
|
||||||
while ((ret = startdisk(dk, chkit)) != 0
|
while ((ret = startdisk(dk, chkit)) &&
|
||||||
&& nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -178,8 +176,8 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
nextdisk->pid == 0)
|
nextdisk->pid == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0
|
while ((ret = startdisk(nextdisk, chkit)) &&
|
||||||
&& nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -206,7 +204,7 @@ finddisk(name)
|
|||||||
{
|
{
|
||||||
register struct disk *dk, **dkp;
|
register struct disk *dk, **dkp;
|
||||||
register char *p;
|
register char *p;
|
||||||
size_t len = 0;
|
size_t len;
|
||||||
|
|
||||||
for (len = strlen(name), p = name + len - 1; p >= name; --p)
|
for (len = strlen(name), p = name + len - 1; p >= name; --p)
|
||||||
if (isdigit(*p)) {
|
if (isdigit(*p)) {
|
||||||
|
@ -42,8 +42,6 @@ static const char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
|
|||||||
#include <ufs/ufs/dir.h>
|
#include <ufs/ufs/dir.h>
|
||||||
#include <ufs/ffs/fs.h>
|
#include <ufs/ffs/fs.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -168,7 +166,8 @@ checkinode(inumber, idesc)
|
|||||||
* Fake ndb value so direct/indirect block checks below
|
* Fake ndb value so direct/indirect block checks below
|
||||||
* will detect any garbage after symlink string.
|
* will detect any garbage after symlink string.
|
||||||
*/
|
*/
|
||||||
if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) {
|
if (dp->di_size < sblock.fs_maxsymlinklen ||
|
||||||
|
dp->di_blocks == 0) {
|
||||||
ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
|
ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
|
||||||
if (ndb > NDADDR) {
|
if (ndb > NDADDR) {
|
||||||
j = ndb - NDADDR;
|
j = ndb - NDADDR;
|
||||||
|
@ -38,13 +38,12 @@ static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include <ufs/ufs/dinode.h>
|
#include <ufs/ufs/dinode.h>
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <fstab.h>
|
#include <fstab.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "fsck.h"
|
#include "fsck.h"
|
||||||
|
|
||||||
@ -124,8 +123,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
maxrun = ndisks;
|
maxrun = ndisks;
|
||||||
nextdisk = disks;
|
nextdisk = disks;
|
||||||
for (passno = 0; passno < maxrun; ++passno) {
|
for (passno = 0; passno < maxrun; ++passno) {
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
while ((ret = startdisk(nextdisk, chkit)) && nrun > 0)
|
||||||
nrun > 0)
|
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -164,8 +162,8 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
|
|
||||||
if (nextdisk == NULL) {
|
if (nextdisk == NULL) {
|
||||||
if (dk->part) {
|
if (dk->part) {
|
||||||
while ((ret = startdisk(dk, chkit)) != 0
|
while ((ret = startdisk(dk, chkit)) &&
|
||||||
&& nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -178,8 +176,8 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
nextdisk->pid == 0)
|
nextdisk->pid == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0
|
while ((ret = startdisk(nextdisk, chkit)) &&
|
||||||
&& nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -206,7 +204,7 @@ finddisk(name)
|
|||||||
{
|
{
|
||||||
register struct disk *dk, **dkp;
|
register struct disk *dk, **dkp;
|
||||||
register char *p;
|
register char *p;
|
||||||
size_t len = 0;
|
size_t len;
|
||||||
|
|
||||||
for (len = strlen(name), p = name + len - 1; p >= name; --p)
|
for (len = strlen(name), p = name + len - 1; p >= name; --p)
|
||||||
if (isdigit(*p)) {
|
if (isdigit(*p)) {
|
||||||
|
@ -42,8 +42,6 @@ static const char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
|
|||||||
#include <ufs/ufs/dir.h>
|
#include <ufs/ufs/dir.h>
|
||||||
#include <ufs/ffs/fs.h>
|
#include <ufs/ffs/fs.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -168,7 +166,8 @@ checkinode(inumber, idesc)
|
|||||||
* Fake ndb value so direct/indirect block checks below
|
* Fake ndb value so direct/indirect block checks below
|
||||||
* will detect any garbage after symlink string.
|
* will detect any garbage after symlink string.
|
||||||
*/
|
*/
|
||||||
if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) {
|
if (dp->di_size < sblock.fs_maxsymlinklen ||
|
||||||
|
dp->di_blocks == 0) {
|
||||||
ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
|
ndb = howmany(dp->di_size, sizeof(ufs_daddr_t));
|
||||||
if (ndb > NDADDR) {
|
if (ndb > NDADDR) {
|
||||||
j = ndb - NDADDR;
|
j = ndb - NDADDR;
|
||||||
|
@ -38,13 +38,12 @@ static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include <ufs/ufs/dinode.h>
|
#include <ufs/ufs/dinode.h>
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <fstab.h>
|
#include <fstab.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "fsck.h"
|
#include "fsck.h"
|
||||||
|
|
||||||
@ -124,8 +123,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
maxrun = ndisks;
|
maxrun = ndisks;
|
||||||
nextdisk = disks;
|
nextdisk = disks;
|
||||||
for (passno = 0; passno < maxrun; ++passno) {
|
for (passno = 0; passno < maxrun; ++passno) {
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
while ((ret = startdisk(nextdisk, chkit)) && nrun > 0)
|
||||||
nrun > 0)
|
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -164,8 +162,8 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
|
|
||||||
if (nextdisk == NULL) {
|
if (nextdisk == NULL) {
|
||||||
if (dk->part) {
|
if (dk->part) {
|
||||||
while ((ret = startdisk(dk, chkit)) != 0
|
while ((ret = startdisk(dk, chkit)) &&
|
||||||
&& nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -178,8 +176,8 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
nextdisk->pid == 0)
|
nextdisk->pid == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0
|
while ((ret = startdisk(nextdisk, chkit)) &&
|
||||||
&& nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -206,7 +204,7 @@ finddisk(name)
|
|||||||
{
|
{
|
||||||
register struct disk *dk, **dkp;
|
register struct disk *dk, **dkp;
|
||||||
register char *p;
|
register char *p;
|
||||||
size_t len = 0;
|
size_t len;
|
||||||
|
|
||||||
for (len = strlen(name), p = name + len - 1; p >= name; --p)
|
for (len = strlen(name), p = name + len - 1; p >= name; --p)
|
||||||
if (isdigit(*p)) {
|
if (isdigit(*p)) {
|
||||||
|
@ -38,13 +38,12 @@ static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include <ufs/ufs/dinode.h>
|
#include <ufs/ufs/dinode.h>
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <fstab.h>
|
#include <fstab.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "fsck.h"
|
#include "fsck.h"
|
||||||
|
|
||||||
@ -124,8 +123,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
maxrun = ndisks;
|
maxrun = ndisks;
|
||||||
nextdisk = disks;
|
nextdisk = disks;
|
||||||
for (passno = 0; passno < maxrun; ++passno) {
|
for (passno = 0; passno < maxrun; ++passno) {
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
while ((ret = startdisk(nextdisk, chkit)) && nrun > 0)
|
||||||
nrun > 0)
|
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -164,8 +162,8 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
|
|
||||||
if (nextdisk == NULL) {
|
if (nextdisk == NULL) {
|
||||||
if (dk->part) {
|
if (dk->part) {
|
||||||
while ((ret = startdisk(dk, chkit)) != 0
|
while ((ret = startdisk(dk, chkit)) &&
|
||||||
&& nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -178,8 +176,8 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
nextdisk->pid == 0)
|
nextdisk->pid == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0
|
while ((ret = startdisk(nextdisk, chkit)) &&
|
||||||
&& nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -206,7 +204,7 @@ finddisk(name)
|
|||||||
{
|
{
|
||||||
register struct disk *dk, **dkp;
|
register struct disk *dk, **dkp;
|
||||||
register char *p;
|
register char *p;
|
||||||
size_t len = 0;
|
size_t len;
|
||||||
|
|
||||||
for (len = strlen(name), p = name + len - 1; p >= name; --p)
|
for (len = strlen(name), p = name + len - 1; p >= name; --p)
|
||||||
if (isdigit(*p)) {
|
if (isdigit(*p)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user