Commit of the code which was suggested by Georg as a fix for:
[cake.git] / rom / dos / samedevice.c
blobe8f8029f274e8b46497f4ef5e0f800b18016ad21
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include "dos_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/dos.h>
15 AROS_LH2(BOOL, SameDevice,
17 /* SYNOPSIS */
18 AROS_LHA(BPTR, lock1, D1),
19 AROS_LHA(BPTR, lock2, D2),
21 /* LOCATION */
22 struct DosLibrary *, DOSBase, 164, Dos)
24 /* FUNCTION
26 INPUTS
28 RESULT
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 *****************************************************************************/
42 AROS_LIBFUNC_INIT
44 struct FileHandle *fh1, *fh2;
46 if (lock1 == NULL || lock2 == NULL)
47 return DOSFALSE;
49 fh1 = (struct FileHandle *)BADDR(lock1);
50 fh2 = (struct FileHandle *)BADDR(lock2);
52 /* XXX this isn't enough. two filesystems of the same type are different
53 * "devices" but will have the same value for fh_Device. there's no good
54 * way to fix (the only bad way involves hoops with NameFromLock() */
55 if (fh1->fh_Device == fh2->fh_Device)
56 return DOSTRUE;
59 return DOSFALSE;
60 AROS_LIBFUNC_EXIT
61 } /* SameDevice */