On 06/15/2015 11:56:41 PM, walt wrote: > Hi Helmut. sys-apps/udevil failed to compile this morning and I > noticed you > had already submitted a proposed fix for it (your patch worked, thank > you). > > The failing code was already in the udevil package when I emerged it > on Jan > 21 with no problems, so some other package must have changed since Jan > 21, > but which one(s)? > > I ask the question because I want to learn to think like a developer > (hold > all snarky comments until the professionals get here) so could you > describe > how you arrived at your fix so quickly? > > Have you used the "stat" function so often that you didn't even need > to think > about how to fix it, or was it more complicated? > > Thanks for any wisdom you care to share with us. >
The build log says device-info.c:943:33: error: implicit declaration of function 'stat' [-Werror=implicit-function-declaration] stat( mount_source, &statbuf ) == 0 && ^ device-info.c:944:33: error: implicit declaration of function 'S_ISBLK' [-Werror=implicit-function-declaration] S_ISBLK( statbuf.st_mode ) ) which means the function stat isn't declared. Together with S_ISBLK it is clear that the C-function stat (to determine file status) is meant. man lstat (man stat doesn't work here) shows which header files have to be included. Furthermore grep -rF /usr/include S_ISBLK shows /usr/include/sys/stat.h:#define S_ISBLK(mode) .... Therefore <sys/stat.h> has to be included somewhere . No wisdom at all, Helmut