Fix for the (stupid) case of app (always) passing
[tangerine.git] / rom / dos / unlockrecord.c
blob51fb078c41016e10181383305adea386384ae31e
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include "dos_intern.h"
10 #include <dos/filesystem.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
15 NAME */
16 #include <proto/dos.h>
18 AROS_LH3(BOOL, UnLockRecord,
20 /* SYNOPSIS */
21 AROS_LHA(BPTR , fh, D1),
22 AROS_LHA(ULONG, offset, D2),
23 AROS_LHA(ULONG, length, D3),
25 /* LOCATION */
26 struct DosLibrary *, DOSBase, 47, Dos)
28 /* FUNCTION
30 Release a lock made with LockRecord().
32 INPUTS
34 fh -- filehandle the lock was made on
35 offset -- starting position of the lock
36 length -- length of the record in bytes
38 RESULT
40 NOTES
42 The length and offset must match the corresponding LockRecord()
43 call.
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 LockRecord(), UnLockRecords()
53 INTERNALS
55 *****************************************************************************/
57 AROS_LIBFUNC_INIT
58 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
60 struct IOFileSys iofs;
61 struct FileHandle *fileH = fh;
63 if (fh == NULL)
65 return DOSFALSE;
68 InitIOFS(&iofs, FSA_UNLOCK_RECORD, DOSBase);
70 iofs.IOFS.io_Device = fileH->fh_Device;
71 iofs.IOFS.io_Unit = fileH->fh_Unit;
73 iofs.io_Union.io_RECORD.io_Offset = offset;
74 iofs.io_Union.io_RECORD.io_Size = length;
76 DosDoIO(&iofs.IOFS);
78 SetIoErr(iofs.io_DosError);
80 if (iofs.io_DosError != 0)
82 return DOSFALSE;
85 return DOSTRUE;
87 AROS_LIBFUNC_EXIT
88 } /* UnLockRecord */