/*static char *SCCSID = "@(#)oftcorr.c	6.2 92/01/31";*/
#define _BTXT _BTXT
#define INCL_DOSERRORS
#include <os2def.h>
#include <bse.h>
#include "const.h"
#include "misc.h"
#include "chain.h"
#include "buf.h"
#include "dir.h"
#include "storage.h"
#include "volume.h"
#include "tables.h"
#include "frame.h"
#include "lw.h"
#include "fsdata.h"
#include "pr_fssub.h"
#include "pr_debug.h"

/*
 ***	OFTCorrupt - Mark OFT Corrupt
 *
 *	OFTCorrupt sets the "corrupt" mark on the OFT, jams a hard error
 *	code if there isn't one already, and setups to return from
 *	hard error.  These are redundant so that OFTCorrupt can be called
 *	two ways: mark a file Corrupt and continue doing some stuff,
 *	or mark it Corrupt and return now.
 *
 *	ENTRY	poft (edi) = OFT address
 *	EXIT	returns first hard error code encountered
 */

USHORT far
OFTCorrupt (poft,pfrm)
POFT poft;
PFRAME pfrm;
{
#ifdef DEBUG
	dprintf ("OFTCorrupt: poft=%p\n", poft);
	Int3 ();
#endif
	poft->bCorrupt = ERROR_READ_FAULT;
	SETHARDERR (ERROR_READ_FAULT);
	return (GetHardErr (ERROR_READ_FAULT));
}
