diff options
Diffstat (limited to 'tests/libfstree/epoch.c')
-rw-r--r-- | tests/libfstree/epoch.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/libfstree/epoch.c b/tests/libfstree/epoch.c index e36cd5b..354a33f 100644 --- a/tests/libfstree/epoch.c +++ b/tests/libfstree/epoch.c @@ -8,9 +8,28 @@ #include "internal.h" #include "../test.h" -int main(void) +#if defined(_WIN32) || defined(__WINDOWS__) +static void setenv(const char *key, const char *value, int overwrite) +{ + char buffer[128]; + (void)overwrite; + + snprintf(buffer, sizeof(buffer) - 1, "%s=%s", key, value); + buffer[sizeof(buffer) - 1] = '\0'; + + _putenv(buffer); +} + +static void unsetenv(const char *key) +{ + setenv(key, "", 0); +} +#endif + +int main(int argc, char **argv) { sqfs_u32 ts; + (void)argc; (void)argv; unsetenv("SOURCE_DATE_EPOCH"); ts = get_source_date_epoch(); |