1 |
On 06/16/2015 02:32 AM, Helmut Jarausch wrote: |
2 |
> On 06/15/2015 11:56:41 PM, walt wrote: |
3 |
>> Hi Helmut. sys-apps/udevil failed to compile this morning and I |
4 |
>> noticed you |
5 |
>> had already submitted a proposed fix for it (your patch worked, thank |
6 |
>> you). |
7 |
>> |
8 |
>> The failing code was already in the udevil package when I emerged it |
9 |
>> on Jan |
10 |
>> 21 with no problems, so some other package must have changed since Jan |
11 |
>> 21, |
12 |
>> but which one(s)? |
13 |
>> |
14 |
>> I ask the question because I want to learn to think like a developer |
15 |
>> (hold |
16 |
>> all snarky comments until the professionals get here) so could you |
17 |
>> describe |
18 |
>> how you arrived at your fix so quickly? |
19 |
>> |
20 |
>> Have you used the "stat" function so often that you didn't even need |
21 |
>> to think |
22 |
>> about how to fix it, or was it more complicated? |
23 |
>> |
24 |
>> Thanks for any wisdom you care to share with us. |
25 |
>> |
26 |
> |
27 |
> The build log says |
28 |
> |
29 |
> device-info.c:943:33: error: implicit declaration of function 'stat' [-Werror=implicit-function-declaration] |
30 |
> stat( mount_source, &statbuf ) == 0 && |
31 |
> ^ |
32 |
> device-info.c:944:33: error: implicit declaration of function 'S_ISBLK' [-Werror=implicit-function-declaration] |
33 |
> S_ISBLK( statbuf.st_mode ) ) |
34 |
> |
35 |
> which means the function stat isn't declared. Together with S_ISBLK it is clear that the C-function stat (to determine |
36 |
> file status) is meant. |
37 |
> |
38 |
> man lstat (man stat doesn't work here) |
39 |
|
40 |
Strange, it works here. I wonder if the difference is caused by your l10n, or |
41 |
maybe a bug. Are man pages always in English? I've been pondering the switch |
42 |
to man-db but I'm not motivated to deal with any fallout and disk space is cheap. |
43 |
|
44 |
> shows which header files have to be included. |
45 |
> |
46 |
> Furthermore |
47 |
> |
48 |
> grep -rF /usr/include S_ISBLK |
49 |
> shows |
50 |
> /usr/include/sys/stat.h:#define S_ISBLK(mode) .... |
51 |
> |
52 |
> Therefore <sys/stat.h> has to be included somewhere |
53 |
|
54 |
Thanks, good hints. |
55 |
|
56 |
> No wisdom at all, |
57 |
|
58 |
Hm. |