diff --git a/src/xpdev/dirwrap.c b/src/xpdev/dirwrap.c
index b4261a5c1f1c88c6ffe83a1b5c20acddfe39a8a3..3a0708e1c19868fb4efb77ffdcac0495e8795319 100644
--- a/src/xpdev/dirwrap.c
+++ b/src/xpdev/dirwrap.c
@@ -950,8 +950,8 @@ static uint64_t getdiskspace(const char* path, uint64_t unit, bool freespace)
 	struct statvfs fs;
 	uint64_t blocks;
 
-    if (statvfs(path, &fs) < 0)
-    	return 0;
+	if (statvfs(path, &fs) < 0)
+		return 0;
 
 	if(freespace)
 		blocks=fs.f_bavail;
diff --git a/src/xpdev/xpbeep.c b/src/xpdev/xpbeep.c
index 7e703df46ec71c75a9ce026f7cd526174e2d3f08..cfc813dd88d2b14e59bb9995dce2f8627ea5b694 100644
--- a/src/xpdev/xpbeep.c
+++ b/src/xpdev/xpbeep.c
@@ -1183,8 +1183,6 @@ bool xptone(double freq, DWORD duration, enum WAVE_SHAPE shape)
 /****************************************************************************/
 void unix_beep(int freq, int dur)
 {
-	static int console_fd=-1;
-
 #if (defined(__FreeBSD__) && defined(HAS_MACHINE_SPEAKER_H)) || ((defined(__OpenBSD__) || defined(__NetBSD__)) && defined(HAS_MACHINE_SPKR_H))
 	int speaker_fd=-1;
 	tone_t tone;
@@ -1200,6 +1198,8 @@ void unix_beep(int freq, int dur)
 #endif
 
 #if !defined(__GNU__) && !defined(__QNX__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__HAIKU__) && !defined(__EMSCRIPTEN__)
+	static int console_fd=-1;
+
 	if(console_fd == -1) 
   		console_fd = open("/dev/console", O_NOCTTY);