Gentoo Archives: gentoo-user

From: Helmut Jarausch <jarausch@××××××.be>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] udevil question for Helmut Jarausch
Date: Tue, 16 Jun 2015 09:32:47
Message-Id: draPF0XZdL8xBcyxiGf/rK@2+6nZkqHK+6OdobPF1A04
In Reply to: [gentoo-user] udevil question for Helmut Jarausch by walt
1 On 06/15/2015 11:56:41 PM, walt wrote:
2 > Hi Helmut. sys-apps/udevil failed to compile this morning and I
3 > noticed you
4 > had already submitted a proposed fix for it (your patch worked, thank
5 > you).
6 >
7 > The failing code was already in the udevil package when I emerged it
8 > on Jan
9 > 21 with no problems, so some other package must have changed since Jan
10 > 21,
11 > but which one(s)?
12 >
13 > I ask the question because I want to learn to think like a developer
14 > (hold
15 > all snarky comments until the professionals get here) so could you
16 > describe
17 > how you arrived at your fix so quickly?
18 >
19 > Have you used the "stat" function so often that you didn't even need
20 > to think
21 > about how to fix it, or was it more complicated?
22 >
23 > Thanks for any wisdom you care to share with us.
24 >
25
26 The build log says
27
28 device-info.c:943:33: error: implicit declaration of function 'stat' [-Werror=implicit-function-declaration]
29 stat( mount_source, &statbuf ) == 0 &&
30 ^
31 device-info.c:944:33: error: implicit declaration of function 'S_ISBLK' [-Werror=implicit-function-declaration]
32 S_ISBLK( statbuf.st_mode ) )
33
34 which means the function stat isn't declared. Together with S_ISBLK it is clear that the C-function stat (to determine
35 file status) is meant.
36
37 man lstat (man stat doesn't work here)
38 shows which header files have to be included.
39
40 Furthermore
41
42 grep -rF /usr/include S_ISBLK
43 shows
44 /usr/include/sys/stat.h:#define S_ISBLK(mode) ....
45
46 Therefore <sys/stat.h> has to be included somewhere
47 .
48 No wisdom at all,
49 Helmut

Replies

Subject Author
[gentoo-user] Re: udevil question for Helmut Jarausch walt <w41ter@×××××.com>