#else
#include <fcntl.h>
#endif
+#include <msp/core/systemerror.h>
#include <msp/strings/format.h>
-#include "../core/except.h"
#include "timestamp.h"
#include "timezone.h"
#include "units.h"
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)
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));