diff --git a/src/common/util.c b/src/common/util.c
index f5bacfa92226e2559fec118698c6df1259f40cf7..95dea4b69c151d4250896bbc60b3c86e7cbe68e6 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -3443,6 +3443,7 @@ format_hex_number_for_helper_exit_status(unsigned int x, char *buf,
   return len;
 }
 
+#ifndef _WIN32
 /** Format <b>child_state</b> and <b>saved_errno</b> as a hex string placed in
  * <b>hex_errno</b>.  Called between fork and _exit, so must be signal-handler
  * safe.
@@ -3551,6 +3552,7 @@ format_helper_exit_status(unsigned char child_state, int saved_errno,
  done:
   return res;
 }
+#endif
 
 /* Maximum number of file descriptors, if we cannot get it via sysconf() */
 #define DEFAULT_MAX_FD 256
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 53626bb00e499c724e6e7073b7914c49cadf86c3..603eded97d0f3f39125c4499a83add57da7c5a72 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2281,6 +2281,7 @@ test_util_load_win_lib(void *ptr)
 }
 #endif
 
+#ifndef _WIN32
 static void
 clear_hex_errno(char *hex_errno)
 {
@@ -2324,6 +2325,7 @@ test_util_exit_status(void *ptr)
  done:
   ;
 }
+#endif
 
 #ifndef _WIN32
 /** Check that fgets waits until a full line, and not return a partial line, on
@@ -3346,8 +3348,8 @@ struct testcase_t util_tests[] = {
 #ifdef _WIN32
   UTIL_TEST(load_win_lib, 0),
 #endif
-  UTIL_TEST(exit_status, 0),
 #ifndef _WIN32
+  UTIL_TEST(exit_status, 0),
   UTIL_TEST(fgets_eagain, TT_SKIP),
 #endif
   UTIL_TEST(spawn_background_ok, 0),