ferror.c revision 261194
1112158Sdas/*
2112158Sdas * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers.
3112158Sdas *      All rights reserved.
4112158Sdas * Copyright (c) 1990, 1993
5112158Sdas *	The Regents of the University of California.  All rights reserved.
6112158Sdas *
7112158Sdas * This code is derived from software contributed to Berkeley by
8112158Sdas * Chris Torek.
9112158Sdas *
10112158Sdas * By using this file, you agree to the terms and conditions set
11112158Sdas * forth in the LICENSE file which can be found at the top level of
12112158Sdas * the sendmail distribution.
13112158Sdas */
14112158Sdas
15112158Sdas#include <sm/gen.h>
16112158SdasSM_RCSID("@(#)$Id: ferror.c,v 1.14 2013/11/22 20:51:42 ca Exp $")
17112158Sdas#include <sm/io.h>
18112158Sdas#include <sm/assert.h>
19112158Sdas#include "local.h"
20112158Sdas
21112158Sdas/*
22112158Sdas**  SM_IO_ERROR -- subroutine version of the macro sm_io_error.
23112158Sdas**
24112158Sdas**	Parameters:
25112158Sdas**		fp -- file pointer
26112158Sdas**
27112158Sdas**	Returns:
28112158Sdas**		0 (zero) when 'fp' is not in an error state
29112158Sdas**		non-zero when 'fp' is in an error state
30112158Sdas*/
31112158Sdas
32112158Sdas#undef sm_io_error
33112158Sdas
34112158Sdasint
35112158Sdassm_io_error(fp)
36112158Sdas	SM_FILE_T *fp;
37112158Sdas{
38112158Sdas	SM_REQUIRE_ISA(fp, SmFileMagic);
39112158Sdas
40112158Sdas	return sm_error(fp);
41112158Sdas}
42112158Sdas