summaryrefslogtreecommitdiff
path: root/emulators/aranym/files/patch-src_natfeat_hostfs.cpp
blob: 47a78e9447c2a9f427bc1208a520bd35e35ffdfb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
- backport of patch to fix https://github.com/aranym/aranym/issues/77

--- src/natfeat/hostfs.cpp.orig	2019-04-14 14:11:29 UTC
+++ src/natfeat/hostfs.cpp
@@ -2872,7 +2872,22 @@ int32 HostFs::xfs_native_init( int16 devnum, memptr mo
 	 * for drivers that are not running under mint,
 	 * report our current timezone (in the filesys.res1 field)
 	 */
+#if defined(__FreeBSD__) || 1
+	/*
+	 * FreeBSD does not have that global variable.
+	 * Maybe others, too.
+	 */
+	{
+		time_t t;
+		int32_t offset;
+		
+		t = time(0);
+		offset = -gmtoff(t);
+		WriteInt32(filesys + 136, offset);
+	}
+#else
 	WriteInt32(filesys + 136, timezone);
+#endif
 
 	int16 dnum = -1;
 	size_t len = strlen( fmountPoint );