Skip to content

Commit

Permalink
Force a timezone to avoid a bug with UTC/GMT. Fixes #91
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Feb 20, 2019
1 parent 74a180a commit 34f9879
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/dynamips.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <fcntl.h>
#include <assert.h>
#include <getopt.h>
#include <time.h>

#include "dynamips.h"
#include "cpu.h"
Expand Down Expand Up @@ -906,6 +907,13 @@ int main(int argc,char *argv[])
printf("Copyright (c) 2005-2011 Christophe Fillot.\n");
printf("Build date: %s %s\n\n",__DATE__,__TIME__);

/* Force a timezone to avoid a bug with UTC/GMT */
tzset();
if (timezone == 0 && !getenv("TZ")) {
setenv("TZ", "Europe/London", 1);
tzset();
}

/* Register platforms */
register_default_platforms();

Expand Down

0 comments on commit 34f9879

Please sign in to comment.