aboutsummaryrefslogtreecommitdiff
path: root/coreutils/touch.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-15 02:28:56 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-15 02:28:56 +0100
commit389cca4b9ed07be8d873b2aae01f3eb0c3474f7c (patch)
tree4ec81672d1bd6b18578576b876659d6a257ca5ae /coreutils/touch.c
parenta307af1af62c51e33e2801d74dbc35560af0fc0e (diff)
downloadbusybox-w32-389cca4b9ed07be8d873b2aae01f3eb0c3474f7c.tar.gz
busybox-w32-389cca4b9ed07be8d873b2aae01f3eb0c3474f7c.tar.bz2
busybox-w32-389cca4b9ed07be8d873b2aae01f3eb0c3474f7c.zip
some non-gnu compilers can't have non-const struct initializers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/touch.c')
-rw-r--r--coreutils/touch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 7d1bf0d9e..f670b7f6e 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -40,6 +40,9 @@
40int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 40int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
41int touch_main(int argc UNUSED_PARAM, char **argv) 41int touch_main(int argc UNUSED_PARAM, char **argv)
42{ 42{
43 int fd;
44 int status = EXIT_SUCCESS;
45 int opts;
43#if ENABLE_DESKTOP 46#if ENABLE_DESKTOP
44# if ENABLE_LONG_OPTS 47# if ENABLE_LONG_OPTS
45 static const char touch_longopts[] ALIGN1 = 48 static const char touch_longopts[] ALIGN1 =
@@ -49,17 +52,15 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
49 "date\0" Required_argument "d" 52 "date\0" Required_argument "d"
50 ; 53 ;
51# endif 54# endif
52 struct timeval timebuf = {.tv_usec = 0};
53 char *reference_file = NULL; 55 char *reference_file = NULL;
54 char *date_str = NULL; 56 char *date_str = NULL;
57 struct timeval timebuf;
58 timebuf.tv_usec = 0;
55#else 59#else
56# define reference_file NULL 60# define reference_file NULL
57# define date_str NULL 61# define date_str NULL
58# define timebuf (*(struct timeval*)NULL) 62# define timebuf (*(struct timeval*)NULL)
59#endif 63#endif
60 int fd;
61 int status = EXIT_SUCCESS;
62 int opts;
63 64
64#if ENABLE_DESKTOP && ENABLE_LONG_OPTS 65#if ENABLE_DESKTOP && ENABLE_LONG_OPTS
65 applet_long_options = touch_longopts; 66 applet_long_options = touch_longopts;