Attempt to fix rawhide compilation

This commit is contained in:
Bastien Nocera 2018-03-01 17:57:30 +01:00
parent c1b4945d68
commit 5933aa0b8b
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,36 @@
From 7e32487df2c7f8b26f3a66ca1d4fee767eff314e Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 1 Mar 2018 17:56:01 +0100
Subject: [PATCH] Fix compilation on Fedora rawhide
---
src/umockdev-record.vala | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/umockdev-record.vala b/src/umockdev-record.vala
index 1ed4061..2104417 100644
--- a/src/umockdev-record.vala
+++ b/src/umockdev-record.vala
@@ -75,15 +75,15 @@ resolve (string dev)
if (Posix.stat(dev, out st) != 0)
exit_error("Cannot access device %s: %s", dev, strerror(errno));
- uint major = Posix.major(st.st_rdev);
- uint minor = Posix.minor(st.st_rdev);
+ uint major_int = Posix.major(st.st_rdev);
+ uint minor_int = Posix.minor(st.st_rdev);
string link;
// character device?
if (Posix.S_ISCHR(st.st_mode))
- link = "/sys/dev/char/%u:%u".printf(major, minor);
+ link = "/sys/dev/char/%u:%u".printf(major_int, minor_int);
else if (Posix.S_ISBLK(st.st_mode))
- link = "/sys/dev/block/%u:%u".printf(major, minor);
+ link = "/sys/dev/block/%u:%u".printf(major_int, minor_int);
else
link = dev;
--
2.14.3

View File

@ -19,6 +19,9 @@ BuildRequires: chrpath
BuildRequires: gphoto2
BuildRequires: python3
# https://github.com/martinpitt/umockdev/issues/76
Patch0: 0001-Fix-compilation-on-Fedora-rawhide.patch
%description
With this program and libraries you can easily create mock udev objects.
This is useful for writing tests for software which talks to
@ -35,6 +38,7 @@ using %{name}.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%build
NOCONFIGURE=1 ./autogen.sh