/*
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980, 1986, 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that: (1) source distributions retain this entire copyright
* notice and comment, and (2) distributions including binaries display
* the following acknowledgement: ``This product includes software
* developed by the University of California, Berkeley and its contributors''
* in the documentation or other materials provided with the distribution
* and in all advertising materials mentioning features or use of this
* software. Neither the name of the University nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <malloc.h>
#include <signal.h>
#include <sys/sysmacros.h>
#include "fsck.h"
#include <locale.h>
extern char *tagerrs[];
void errexit(char *, ...) __NORETURN;
extern unsigned int largefile_count;
/*
* An unexpected inconsistency occured.
* Die if preening, otherwise just print message and continue.
*/
/* VARARGS1 */
void
{
if (preen) {
(void) printf("\n");
(void) printf(
gettext("%s: UNEXPECTED INCONSISTENCY; RUN fsck "
"MANUALLY.\n"), devname);
exit(36);
}
}
/*
* Pwarn just prints a message when not preening,
* or a warning (preceded by filename) when preening.
*/
/* VARARGS1 */
void
{
if (preen)
}
/* VARARGS1 */
void
{
exit(39);
}
void
{
register int i;
break;
}
else {
n_blks++;
}
}
}
void
{
startfree = -1;
for (i = 0; i < part_len; i++) {
if (!testbusy(i)) {
if (startfree <= 0)
startfree = i;
endfree = i;
} else if (startfree >= 0) {
startfree = -1;
}
}
if (startfree >= 0) {
}
}
struct bufarea *
{
int err;
}
return (NULL);
}
/* LINTED */
if (err) {
return (NULL);
}
return (bp);
}
void
{
/* LINTED */
}
{
if (preen)
return (0);
}
if (yflag) {
return (1);
}
errexit("\n");
(void) printf("\n");
return (1);
else {
return (0);
}
}
{
int n;
register char *p, *lastloc;
p = loc;
if (n == EOF)
return (EOF);
*p++ = n;
}
*p = 0;
return (p - loc);
}
/*
* Malloc buffers and set up cache.
*/
void
bufinit()
{
long bufcnt, i;
char *bufp;
if (bufp == 0)
for (i = 0; i < bufcnt; i++) {
if (i >= MINBUFS)
break;
}
}
}
/*
* Manage a cache of directory blocks.
*/
static struct bufarea *
{
goto foundit;
break;
/* fall through */
totalreads++;
return (bp);
}
static struct bufarea *
{
return (bp);
diskreads++;
return (bp);
}
void
{
return;
}
static void
{
if (preen == 0)
(void) printf("\n");
}
void
ckfini()
{
int cnt = 0;
cnt++;
}
if (debug)
(void) printf("cache missed %ld of %ld (%ld%%)\n",
}
{
char *cp;
int i, errs;
return (0);
errs = 0;
errs++;
}
}
(void) printf("\n");
return (errs);
}
void
{
int i, n;
char *cp;
if (fd < 0)
return;
fsmodified = 1;
return;
}
n = 0;
} else if (n > 0) {
fsmodified = 1;
}
}
(void) printf("\n");
}
void
catch()
{
ckfini();
exit(37);
}
/*
* When preening, allow a single quit to signal
* a special exit after filesystem checks complete
* so that reboot sequence may be interrupted.
*/
void
{
extern int returntosingle;
"check\n"));
returntosingle = 1;
}
/*
* determine whether an inode should be fixed.
*/
/* ARGSUSED1 */
{
case DONTKNOW:
if (preen) {
return (ALTERED);
}
return (0);
}
return (ALTERED);
case FIX:
return (ALTERED);
case NOFIX:
return (0);
default:
}
/* NOTREACHED */
}
/*
* Check to see if unraw version of name is already mounted.
* to see if it is really looks mounted.
*/
int
{
int found = 0;
int err;
return (0);
}
continue;
}
if (err < 0)
continue;
sizeof (mountpoint));
else
}
break;
}
}
return (found);
}
/*
* Check to see if name corresponds to an entry in vfstab, and that the entry
* does not have option ro.
*/
int
{
return (1);
}
rw = 0;
}
return (rw);
}
/*
* print out clean info
*/
void
{
char *s;
switch (lvintp->lvid_int_type) {
case LVI_CLOSE:
s = gettext("clean");
break;
case LVI_OPEN:
s = gettext("active");
break;
default:
s = gettext("unknown");
}
if (preen)
else
}