diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 10 | ||||
-rw-r--r-- | shell/hush.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/shell/ash.c b/shell/ash.c index f16d7fb6a..54f004375 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -11371,10 +11371,10 @@ static void FAST_FUNC | |||
11371 | change_epoch(struct var *vepoch, const char *fmt) | 11371 | change_epoch(struct var *vepoch, const char *fmt) |
11372 | { | 11372 | { |
11373 | struct timeval tv; | 11373 | struct timeval tv; |
11374 | char buffer[sizeof("%lu.nnnnnn") + sizeof(long)*3]; | 11374 | char buffer[sizeof("%llu.nnnnnn") + sizeof(long long)*3]; |
11375 | 11375 | ||
11376 | gettimeofday(&tv, NULL); | 11376 | xgettimeofday(&tv); |
11377 | sprintf(buffer, fmt, (unsigned long)tv.tv_sec, (unsigned)tv.tv_usec); | 11377 | sprintf(buffer, fmt, (unsigned long long)tv.tv_sec, (unsigned)tv.tv_usec); |
11378 | setvar(vepoch->var_text, buffer, VNOFUNC); | 11378 | setvar(vepoch->var_text, buffer, VNOFUNC); |
11379 | vepoch->flags &= ~VNOFUNC; | 11379 | vepoch->flags &= ~VNOFUNC; |
11380 | } | 11380 | } |
@@ -11382,13 +11382,13 @@ change_epoch(struct var *vepoch, const char *fmt) | |||
11382 | static void FAST_FUNC | 11382 | static void FAST_FUNC |
11383 | change_seconds(const char *value UNUSED_PARAM) | 11383 | change_seconds(const char *value UNUSED_PARAM) |
11384 | { | 11384 | { |
11385 | change_epoch(&vepochs, "%lu"); | 11385 | change_epoch(&vepochs, "%llu"); |
11386 | } | 11386 | } |
11387 | 11387 | ||
11388 | static void FAST_FUNC | 11388 | static void FAST_FUNC |
11389 | change_realtime(const char *value UNUSED_PARAM) | 11389 | change_realtime(const char *value UNUSED_PARAM) |
11390 | { | 11390 | { |
11391 | change_epoch(&vepochr, "%lu.%06u"); | 11391 | change_epoch(&vepochr, "%llu.%06u"); |
11392 | } | 11392 | } |
11393 | #endif | 11393 | #endif |
11394 | 11394 | ||
diff --git a/shell/hush.c b/shell/hush.c index 9fead37da..65f08659f 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1027,7 +1027,7 @@ struct globals { | |||
1027 | struct sigaction sa; | 1027 | struct sigaction sa; |
1028 | char optstring_buf[sizeof("eixcs")]; | 1028 | char optstring_buf[sizeof("eixcs")]; |
1029 | #if BASH_EPOCH_VARS | 1029 | #if BASH_EPOCH_VARS |
1030 | char epoch_buf[sizeof("%lu.nnnnnn") + sizeof(long)*3]; | 1030 | char epoch_buf[sizeof("%llu.nnnnnn") + sizeof(long long)*3]; |
1031 | #endif | 1031 | #endif |
1032 | #if ENABLE_FEATURE_EDITING | 1032 | #if ENABLE_FEATURE_EDITING |
1033 | char user_input_buf[CONFIG_FEATURE_EDITING_MAX_LEN]; | 1033 | char user_input_buf[CONFIG_FEATURE_EDITING_MAX_LEN]; |
@@ -2277,13 +2277,13 @@ static const char* FAST_FUNC get_local_var_value(const char *name) | |||
2277 | { | 2277 | { |
2278 | const char *fmt = NULL; | 2278 | const char *fmt = NULL; |
2279 | if (strcmp(name, "EPOCHSECONDS") == 0) | 2279 | if (strcmp(name, "EPOCHSECONDS") == 0) |
2280 | fmt = "%lu"; | 2280 | fmt = "%llu"; |
2281 | else if (strcmp(name, "EPOCHREALTIME") == 0) | 2281 | else if (strcmp(name, "EPOCHREALTIME") == 0) |
2282 | fmt = "%lu.%06u"; | 2282 | fmt = "%llu.%06u"; |
2283 | if (fmt) { | 2283 | if (fmt) { |
2284 | struct timeval tv; | 2284 | struct timeval tv; |
2285 | gettimeofday(&tv, NULL); | 2285 | xgettimeofday(&tv); |
2286 | sprintf(G.epoch_buf, fmt, (unsigned long)tv.tv_sec, | 2286 | sprintf(G.epoch_buf, fmt, (unsigned long long)tv.tv_sec, |
2287 | (unsigned)tv.tv_usec); | 2287 | (unsigned)tv.tv_usec); |
2288 | return G.epoch_buf; | 2288 | return G.epoch_buf; |
2289 | } | 2289 | } |