X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftime%2Ftimezone.cpp;h=873829d667111f86a3e96dbd164d89606f5183d1;hb=1f0843257065789231a9949e0a81b79afd7bbebe;hp=0ec9d2b8e4137300f3139bfb2f5661e7fe3a0764;hpb=90d55c510f5dbd334be3a16017d1cf6ece61cf85;p=libs%2Fcore.git diff --git a/source/time/timezone.cpp b/source/time/timezone.cpp index 0ec9d2b..873829d 100644 --- a/source/time/timezone.cpp +++ b/source/time/timezone.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspcore -Copyright © 2008-2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #ifdef WIN32 #include @@ -12,7 +5,7 @@ Distributed under the LGPL #include #endif #include -#include "../core/except.h" +#include #include "timestamp.h" #include "timezone.h" #include "units.h" @@ -40,7 +33,7 @@ TimeZone get_local_timezone() TIME_ZONE_INFORMATION tzinfo; DWORD dst = GetTimeZoneInformation(&tzinfo); if(dst==TIME_ZONE_ID_INVALID) - throw Msp::SystemError("Failed to get time zone information", GetLastError()); + throw Msp::system_error("GetTimeZoneInformation"); int offset = tzinfo.Bias; if(dst==TIME_ZONE_ID_STANDARD) @@ -51,7 +44,7 @@ TimeZone get_local_timezone() return TimeZone(offset); #else int fd = open("/etc/localtime", O_RDONLY); - if(fd>=-1) + if(fd!=-1) { char hdr[44]; int len = read(fd, hdr, sizeof(hdr));