maint: remove unnecessary include of openat.h
[libguestfs.git] / daemon / realpath.c
index 0dc5fa5..f9d08da 100644 (file)
 #include <sys/types.h>
 #include <dirent.h>
 
-#include "openat.h"
-
 #include "daemon.h"
 #include "actions.h"
 
+/* On Windows, NAME_MAX is not defined. */
+#ifndef NAME_MAX
+#define NAME_MAX FILENAME_MAX
+#endif
+
 char *
 do_realpath (const char *path)
 {
@@ -113,7 +116,7 @@ do_case_sensitive_path (const char *path)
 
     errno = 0;
     while ((d = readdir (dir)) != NULL) {
-      if (strcasecmp (d->d_name, name) == 0)
+      if (STRCASEEQ (d->d_name, name))
         break;
     }