summaryrefslogtreecommitdiff
path: root/src/time
diff options
context:
space:
mode:
Diffstat (limited to 'src/time')
-rw-r--r--src/time/gmtime.c2
-rw-r--r--src/time/localtime.c2
-rw-r--r--src/time/nanosleep.c2
-rw-r--r--src/time/strftime.c12
-rw-r--r--src/time/time.c2
5 files changed, 7 insertions, 13 deletions
diff --git a/src/time/gmtime.c b/src/time/gmtime.c
index 4953d2f0..9850e839 100644
--- a/src/time/gmtime.c
+++ b/src/time/gmtime.c
@@ -1,5 +1,5 @@
#include <time.h>
-#include "../_assert.h"
+#include "_assert.h"
# define SEC_PER_MIN (60L)
# define MIN_PER_HR (60L)
diff --git a/src/time/localtime.c b/src/time/localtime.c
index 80ac9bfa..72040d00 100644
--- a/src/time/localtime.c
+++ b/src/time/localtime.c
@@ -1,5 +1,5 @@
#include <time.h>
-#include "../_assert.h"
+#include "_assert.h"
/** convert arithmetic time to broken down time **/
diff --git a/src/time/nanosleep.c b/src/time/nanosleep.c
index cb1cfef7..5b722ae6 100644
--- a/src/time/nanosleep.c
+++ b/src/time/nanosleep.c
@@ -1,5 +1,5 @@
#include <time.h>
-#include "../_syscall.h"
+#include "_syscall.h"
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
{
diff --git a/src/time/strftime.c b/src/time/strftime.c
index 4d306789..4d3f78c8 100644
--- a/src/time/strftime.c
+++ b/src/time/strftime.c
@@ -1,9 +1,8 @@
#include <time.h>
#include "stdio.h"
-#include "../_assert.h"
+#include "_assert.h"
#include "locale.h"
-#include "../locale/_locale.h"
-#include "../_nonstd.h"
+#include "locale/_locale.h"
/** convert time to a formatted string **/
@@ -11,17 +10,12 @@ size_t strftime(char * restrict s, size_t maxsize, const char * restrict format,
{
size_t converted = 0, i, j;
char buf[64];
- struct __locale_t *lc;
+ struct __locale_t *lc = __get_locale();
ASSERT_NONNULL(s);
ASSERT_NONNULL(format);
ASSERT_NONNULL(timeptr);
- lc = __libc(THREAD_LOCALE);
- if (lc->time[0] == '\0') {
- lc = __libc(GLOBAL_LOCALE);
- }
-
for (i = 0; format[i] != '\0' && converted < maxsize; i++) {
if (format[i] != '%') {
s[converted++] = format[i];
diff --git a/src/time/time.c b/src/time/time.c
index 96e8ed19..ca99964f 100644
--- a/src/time/time.c
+++ b/src/time/time.c
@@ -1,6 +1,6 @@
#include <time.h>
#include "errno.h"
-#include "../_syscall.h"
+#include "_syscall.h"
/** get current time **/