Start of port of AsyncIO library.
[AROS-Contrib.git] / workbench / libs / asyncio / src / RecordAsyncFailure.c
blob3999fa1475255921a08b9b328fd8860ea367daf6
1 #include "async.h"
4 /* this function records a failure from a synchronous DOS call into the
5 * packet so that it gets picked up by the other IO routines in this module
6 */
7 VOID
8 AS_RecordSyncFailure( AsyncFile *file )
10 #ifdef ASIO_NOEXTERNALS
11 struct DosLibrary *DOSBase = file->af_DOSBase;
12 #endif
14 /* MH: Back up some values to make it possible to resume operation
15 * after seeks past EOF.
17 file->af_LastRes1 = file->af_Packet.sp_Pkt.dp_Res1;
18 file->af_LastBytesLeft = file->af_BytesLeft;
20 file->af_Packet.sp_Pkt.dp_Res1 = -1;
21 file->af_Packet.sp_Pkt.dp_Res2 = IoErr();
22 /* MH: To make sure we can't read/write despite an error condition */
23 file->af_BytesLeft = 0;