Check for SYS/GL during library init. Reason is that
[AROS.git] / rom / partition / partition_init.c
blob7f1fbdb23e9a467a84bb34fec7faf30d4bd605e6
1 /*
2 Copyright © 2001-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Partition initialization code
6 Lang: English
7 */
9 #include <aros/symbolsets.h>
10 #include <aros/debug.h>
11 #include <proto/alib.h>
13 #include "partition_intern.h"
14 #include "partition_support.h"
15 #include LC_LIBDEFS_FILE
17 static int PartitionInit(LIBBASETYPEPTR LIBBASE)
19 LIBBASE->partbase.tables = (struct PartitionTableInfo **)PartitionSupport;
20 NewList(&LIBBASE->bootList);
21 InitSemaphore(&LIBBASE->bootSem);
24 * This is intentionally allowed to fail.
25 * It will fail if we are in kickstart; partition.library is initialized
26 * long before dos.library.
28 LIBBASE->pb_DOSBase = OpenLibrary("dos.library", 36);
30 return TRUE;
33 static int PartitionCleanup(struct PartitionBase_intern *base)
35 /* If there's something in our boot list, we can't quit without losing it */
36 if (!IsListEmpty(&base->bootList))
37 return FALSE;
39 if (base->pb_DOSBase)
40 CloseLibrary(base->pb_DOSBase);
42 return TRUE;
45 ADD2INITLIB(PartitionInit, 0);
46 ADD2EXPUNGELIB(PartitionCleanup, 0);