#include "elput_private.h"
#ifdef HAVE_SYSTEMD
+
+# ifdef major
+# define MAJOR(x) major(x)
+# else
+# define MAJOR(x) ((((x) >> 8) & 0xfff) | (((x) >> 32) & ~0xfff))
+# endif
+
+# ifdef minor
+# define MINOR(x) minor(x)
+# else
+# define MAJOR(x) (((x) & 0xff) | (((x) >> 12) & ~0xff))
+# endif
+
static Eina_Module *_libsystemd = NULL;
static Eina_Bool _libsystemd_broken = EINA_FALSE;
if ((stat(path, &st) < 0) || (!S_ISCHR(st.st_mode)))
_logind_pipe_write_fd(em, fd);
else
- _logind_device_take_async(em, flags, major(st.st_rdev), minor(st.st_rdev));
+ _logind_device_take_async(em, flags, MAJOR(st.st_rdev), MINOR(st.st_rdev));
}
static int
if (!S_ISCHR(st.st_mode)) return -1;
- fd = _logind_device_take(em, major(st.st_rdev), minor(st.st_rdev));
+ fd = _logind_device_take(em, MAJOR(st.st_rdev), MINOR(st.st_rdev));
if (fd < 0) return fd;
- if (major(st.st_rdev) == 226) //DRM_MAJOR
+ if (MAJOR(st.st_rdev) == 226) //DRM_MAJOR
em->drm_opens++;
fl = fcntl(fd, F_GETFL);
err:
close(fd);
- _logind_device_release(em, major(st.st_rdev), minor(st.st_rdev));
+ _logind_device_release(em, MAJOR(st.st_rdev), MINOR(st.st_rdev));
return -1;
}
if (!S_ISCHR(st.st_mode)) return;
- _logind_device_release(em, major(st.st_rdev), minor(st.st_rdev));
+ _logind_device_release(em, MAJOR(st.st_rdev), MINOR(st.st_rdev));
}
static Eina_Bool