blob: 099256fdcdca4c810fda6728169c9c9692a12d42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
https://bugs.gentoo.org/580494
From 5f1d6f46c8c1ac134841cfcce22dc7639598e032 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 19 Apr 2016 03:07:23 -0400
Subject: [PATCH] include sys/sysmacros.h for major/minor
These funcs are defined in sys/sysmacros.h, so include it to avoid:
lsscsi.c: In function 'collect_dev_nodes':
lsscsi.c:961:32: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration]
cur_ent->maj = major(stats.st_rdev);
^
lsscsi.c:962:32: warning: implicit declaration of function 'minor' [-Wimplicit-function-declaration]
cur_ent->min = minor(stats.st_rdev);
^
lsscsi.o: In function 'get_dev_node':
lsscsi.c:(.text+0x10f0): undefined reference to 'major'
lsscsi.c:(.text+0x1117): undefined reference to 'minor'
---
src/lsscsi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lsscsi.c b/src/lsscsi.c
index e494169..61cfebd 100644
--- a/src/lsscsi.c
+++ b/src/lsscsi.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <getopt.h>
#include <fcntl.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
--
2.7.4
|