Move errno-protection into string_open_failed()
[exim.git] / src / src / lookups / dsearch.c
index 501293ac0330c8f58f7778fe082efee6551f8bd1..a6b331edb6401e2932caf3d6d3543d3e7e2f4add 100644 (file)
@@ -31,9 +31,7 @@ dsearch_open(const uschar * dirname, uschar ** errmsg)
 DIR * dp = exim_opendir(dirname);
 if (!dp)
   {
-  int save_errno = errno;
-  *errmsg = string_open_failed(errno, "%s for directory search", dirname);
-  errno = save_errno;
+  *errmsg = string_open_failed("%s for directory search", dirname);
   return NULL;
   }
 closedir(dp);
@@ -86,10 +84,6 @@ int save_errno;
 uschar * filename;
 unsigned flags = 0;
 
-handle = handle;  /* Keep picky compilers happy */
-length = length;
-do_cache = do_cache;
-
 if (Ustrchr(keystring, '/') != 0)
   {
   *errmsg = string_sprintf("key for dsearch lookup contains a slash: %s",