--- a/src/fsel.c
+++ b/src/fsel.c
@@ -68,7 +68,7 @@
 static void  fixPath(Str *pathOut, const char *pathIn);
 static void  addCwd(Str *pathOut);
 static bool  maskMatch(const char *mask, const char *fName, int fLen);
-static void  dirError(AbutFsel *f, int errno, const char *badDir);
+static void  dirError(AbutFsel *f, int errnum, const char *badDir);
 static ButOut  msgDead(void *packet);
 static ButOut  msgOkBut(But *but);
 
@@ -431,7 +431,7 @@
 
   d = opendir(path);
   if (d == NULL)  {
-    dirError(f, errno, path);
+    dirError(f, errnum, path);
     return(FALSE);
   }
   dirs = wms_malloc(maxDirs * sizeof(Str));
@@ -577,7 +577,7 @@
 
   result = getcwd(dirBuf, sizeof(dirBuf));
   if (result == NULL)  {
-    while (errno == ERANGE)  {
+    while (errnum == ERANGE)  {
       len *= 2;
       tmpBuf = wms_malloc(len);
       result = getcwd(tmpBuf, len);
@@ -626,7 +626,7 @@
 }
 
 
-static void  dirError(AbutFsel *f, int errno, const char *badDir)  {
+static void  dirError(AbutFsel *f, int errnum, const char *badDir)  {
   Str  fullError;
   AbutMsgOpt  okBut;
 
@@ -639,7 +639,7 @@
   okBut.packet = f;
   okBut.keyEq = NULL;
   str_init(&fullError);
-  str_print(&fullError, abutFsel_dirErrMessage, strerror(errno), badDir);
+  str_print(&fullError, abutFsel_dirErrMessage, strerror(errnum), badDir);
   f->msg = abutMsg_optCreate(f->abut, f->win, 2, str_chars(&fullError),
 			     msgDead, f, 1, &okBut);
 }
