140266059SGregory Neil Shapiro /* 25dd76dd0SGregory Neil Shapiro * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers. 340266059SGregory Neil Shapiro * All rights reserved. 440266059SGregory Neil Shapiro * Copyright (c) 1990, 1993 540266059SGregory Neil Shapiro * The Regents of the University of California. All rights reserved. 640266059SGregory Neil Shapiro * 740266059SGregory Neil Shapiro * This code is derived from software contributed to Berkeley by 840266059SGregory Neil Shapiro * Chris Torek. 940266059SGregory Neil Shapiro * 1040266059SGregory Neil Shapiro * By using this file, you agree to the terms and conditions set 1140266059SGregory Neil Shapiro * forth in the LICENSE file which can be found at the top level of 1240266059SGregory Neil Shapiro * the sendmail distribution. 1340266059SGregory Neil Shapiro */ 1440266059SGregory Neil Shapiro 1540266059SGregory Neil Shapiro #include <sm/gen.h> 16*4313cc83SGregory Neil Shapiro SM_RCSID("@(#)$Id: ferror.c,v 1.14 2013-11-22 20:51:42 ca Exp $") 1740266059SGregory Neil Shapiro #include <sm/io.h> 1840266059SGregory Neil Shapiro #include <sm/assert.h> 1940266059SGregory Neil Shapiro #include "local.h" 2040266059SGregory Neil Shapiro 2140266059SGregory Neil Shapiro /* 2240266059SGregory Neil Shapiro ** SM_IO_ERROR -- subroutine version of the macro sm_io_error. 2340266059SGregory Neil Shapiro ** 2440266059SGregory Neil Shapiro ** Parameters: 2540266059SGregory Neil Shapiro ** fp -- file pointer 2640266059SGregory Neil Shapiro ** 2740266059SGregory Neil Shapiro ** Returns: 2840266059SGregory Neil Shapiro ** 0 (zero) when 'fp' is not in an error state 2940266059SGregory Neil Shapiro ** non-zero when 'fp' is in an error state 3040266059SGregory Neil Shapiro */ 3140266059SGregory Neil Shapiro 3240266059SGregory Neil Shapiro #undef sm_io_error 3340266059SGregory Neil Shapiro 3440266059SGregory Neil Shapiro int 3540266059SGregory Neil Shapiro sm_io_error(fp) 3640266059SGregory Neil Shapiro SM_FILE_T *fp; 3740266059SGregory Neil Shapiro { 3840266059SGregory Neil Shapiro SM_REQUIRE_ISA(fp, SmFileMagic); 3940266059SGregory Neil Shapiro 4040266059SGregory Neil Shapiro return sm_error(fp); 4140266059SGregory Neil Shapiro } 42