diff --git a/ProcessUNIX.c b/ProcessUNIX.c
index 19cbee8f1da723fd50c091d35937a5ebe14deacb..b8e4b75cac11843056417d87f7a5cb01222e5204 100644
--- a/ProcessUNIX.c
+++ b/ProcessUNIX.c
@@ -2137,10 +2137,11 @@ static void kwsysProcessChildErrorExit(int errorPipe)
 {
   /* Construct the error message.  */
   char buffer[KWSYSPE_PIPE_BUFFER_SIZE];
+  kwsysProcess_ssize_t result;
   strncpy(buffer, strerror(errno), KWSYSPE_PIPE_BUFFER_SIZE);
 
   /* Report the error to the parent through the special pipe.  */
-  kwsysProcess_ssize_t result=write(errorPipe, buffer, strlen(buffer));
+  result=write(errorPipe, buffer, strlen(buffer));
   (void)result;
 
   /* Terminate without cleanup.  */