Lilo 24.2 on musl

Lilo 24.2 opens devices in mode 3 (a linuxism that means ioctls only). As it happens, O_ACCMODE (which is a mask, not a mode) is equal to 3. Or at least it used to be, because on modern musl, O_ACCMODE now includes O_PATH which makes Lilo choke on Fatal: geo_query_dev HDIO_GETGEO (dev 0x0800): Bad file descriptor. No more.

--- a/src/common.h
+++ b/src/common.h
@@ -25,6 +25,1 @@
-#ifdef O_ACCMODE
-# define O_NOACCESS O_ACCMODE
-#else
-/* open a file for "no access" */
-# define O_NOACCESS 3
-#endif
+#define O_NOACCESS 3

Date: 2022-03-20 11:53:11