[Yaffs] fix for mkyaffsimage compile error

Tony Ibbs tibs@sj.co.uk
Tue, 23 Nov 2004 09:43:56 +0000


Frank Rowand wrote:
> When I compile mkyaffsimage on RedHat 9.0, I get errors that look
> like the errors reported in the email thread "Compile error when using
> yaffs/direct" started by Daniel Gustafsson, Fri, 8 Oct 2004 15:28:35.
> 
> The problem is caused by some #define statements in
> /usr/include/bits/stat.h:
> 
>    # define st_atime st_atim.tv_sec        /* Backward compatibility.  */
>    # define st_mtime st_mtim.tv_sec
>    # define st_ctime st_ctim.tv_sec
> 
> The attached patch is one way to fix the problem for mkyaffsimage.

An alternative is to specify -D_POSIX_SOURCE to gcc, as suggested by the 
FreeBSD "man 2 stat" (so I assume this problem would show up on BSD as 
well). Not sure if that's a better or worse solution.

Tibs