Blob Blame History Raw
From 7bf30c52a37118ff4f211e67e1736099f3d1dcb3 Mon Sep 17 00:00:00 2001
From: Gerlof Langeveld <gerlof.langeveld@atoptool.nl>
Date: Sat, 22 Sep 2018 11:50:50 +0200
Subject: [PATCH] Own macro's added to determine major/minor of logical volume.
 The standard 'minor' and 'major' macro's are not available any more in gcc8.

---
 photosyst.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/photosyst.c b/photosyst.c
index 19cbbe1..019b9e0 100644
--- a/photosyst.c
+++ b/photosyst.c
@@ -184,6 +184,9 @@ static const char rcsid[] = "$Id: photosyst.c,v 1.38 2010/11/19 07:40:40 gerlof
 
 #define	MAXCNT	64
 
+#define MAJOR(x)        ((((unsigned long long)x>>8)&0xfff)|((unsigned int)((unsigned long long)x>>32)&~0xfff))
+#define MINOR(x)        ((x&0xff)|((unsigned int)((unsigned long long)x>>12)&~0xff))
+
 /* return value of isdisk() */
 #define	NONTYPE	0
 #define	DSKTYPE	1
@@ -1479,8 +1482,8 @@ lvmmapname(unsigned int major, unsigned int minor,
 				*/
 				strncpy(dmp->name, dentry->d_name, MAXDKNAM);
 				dmp->name[MAXDKNAM-1] = 0;
-				dmp->major 	= major(statbuf.st_rdev);
-				dmp->minor 	= minor(statbuf.st_rdev);
+				dmp->major 	= MAJOR(statbuf.st_rdev);
+				dmp->minor 	= MINOR(statbuf.st_rdev);
 
 				hashix = DMHASH(dmp->major, dmp->minor);