bump version
[AROS.git] / rom / dos / unlock.c
blob5fb068d9c3178e26b294b2775420f5ddc8d9ba24
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include <proto/exec.h>
10 #include <dos/dosextens.h>
11 #include <proto/dos.h>
12 #include "dos_intern.h"
13 #include <aros/debug.h>
15 /*****************************************************************************
17 NAME */
18 #include <proto/dos.h>
20 AROS_LH1(BOOL, UnLock,
22 /* SYNOPSIS */
23 AROS_LHA(BPTR, lock, D1),
25 /* LOCATION */
26 struct DosLibrary *, DOSBase, 15, Dos)
29 FUNCTION
30 Free a lock created with Lock().
32 INPUTS
33 lock - The lock to free
35 RESULT
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 /* Get pointer to filehandle */
52 struct FileLock *fl = BADDR(lock);
54 ASSERT_VALID_PTR_OR_NULL(fl);
55 ASSERT_VALID_FILELOCK(lock);
57 D(bug("UnLock(%x)\n", fl));
59 /* 0 handles are OK */
60 if(lock == BNULL)
61 return 0;
63 return dopacket1(DOSBase, NULL, fl->fl_Task, ACTION_FREE_LOCK, lock) != 0;
65 AROS_LIBFUNC_EXIT
66 } /* UnLock */