$OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.25 2019/08/21 05:47:40 rsadowski Exp $

Don't spam systrace by attempting to create dirs which already exist

Index: Source/kwsys/SystemTools.cxx
--- Source/kwsys/SystemTools.cxx.orig
+++ Source/kwsys/SystemTools.cxx
@@ -292,12 +292,14 @@ inline void Realpath(const std::string& path, std::str
 }
 #else
 #  include <sys/types.h>
+#  include <sys/stat.h>
 
 #  include <fcntl.h>
 #  include <unistd.h>
 inline int Mkdir(const std::string& dir)
 {
-  return mkdir(dir.c_str(), 00777);
+  struct stat sb;
+  return stat(dir.c_str(), &sb) && mkdir(dir.c_str(), 00777);
 }
 inline int Rmdir(const std::string& dir)
 {
