summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko2009-11-15 02:28:56 +0100
committerDenys Vlasenko2009-11-15 02:28:56 +0100
commit389cca4b9ed07be8d873b2aae01f3eb0c3474f7c (patch)
tree4ec81672d1bd6b18578576b876659d6a257ca5ae /coreutils
parenta307af1af62c51e33e2801d74dbc35560af0fc0e (diff)
downloadbusybox-389cca4b9ed07be8d873b2aae01f3eb0c3474f7c.zip
busybox-389cca4b9ed07be8d873b2aae01f3eb0c3474f7c.tar.gz
some non-gnu compilers can't have non-const struct initializers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/touch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 7d1bf0d..f670b7f 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -40,6 +40,9 @@
int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int touch_main(int argc UNUSED_PARAM, char **argv)
{
+ int fd;
+ int status = EXIT_SUCCESS;
+ int opts;
#if ENABLE_DESKTOP
# if ENABLE_LONG_OPTS
static const char touch_longopts[] ALIGN1 =
@@ -49,17 +52,15 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
"date\0" Required_argument "d"
;
# endif
- struct timeval timebuf = {.tv_usec = 0};
char *reference_file = NULL;
char *date_str = NULL;
+ struct timeval timebuf;
+ timebuf.tv_usec = 0;
#else
# define reference_file NULL
# define date_str NULL
# define timebuf (*(struct timeval*)NULL)
#endif
- int fd;
- int status = EXIT_SUCCESS;
- int opts;
#if ENABLE_DESKTOP && ENABLE_LONG_OPTS
applet_long_options = touch_longopts;