Bug 2515 - date.c may need _SVID_SOURCE=1
Summary: date.c may need _SVID_SOURCE=1
Status: RESOLVED WORKSFORME
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.17.x
Hardware: Other Linux
: P5 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-04 15:12 UTC by Sergio Costas
Modified: 2010-12-30 23:14 UTC (History)
1 user (show)

See Also:
Host: X86
Target: Mips
Build:


Attachments
Patch to fix the compilation error in date.c (359 bytes, patch)
2010-09-04 15:12 UTC, Sergio Costas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Costas 2010-09-04 15:12:00 UTC
Created attachment 2437 [details]
Patch to fix the compilation error in date.c

I've been cross-compiling busybox under Gentoo for MIPS, and version 1.17.1 is impossible to compile because it returns the error:

coreutils/date.c: In function 'date_main':
coreutils/date.c:210: error: 'struct stat' has no member named 'st_mtim'

The bug is in your official version too.

I attach a patch which fixes it (I sent it to Gentoo too).
Comment 1 Denys Vlasenko 2010-09-17 16:45:50 UTC
Different libc's require different magic to refer to nanosecond times in struct stat.

Does it help if you add

#define _SVID_SOURCE 1

in date.c?
Comment 2 Denys Vlasenko 2010-10-28 22:29:55 UTC
Ping?