]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3664: ssl_crtd fails to build on OpenSolaris/OpenIndiana/Solaris 11
authorAndrew Evdokimov <ae@elahi.ru>
Fri, 2 Jan 2015 13:20:24 +0000 (05:20 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 2 Jan 2015 13:20:24 +0000 (05:20 -0800)
src/ssl/certificate_db.cc

index f495ef153caa68f3fd2ff3cafe55ebb0346a90c5..a2d920030d601e1861417397b2560510bf7ff267 100644 (file)
@@ -50,7 +50,7 @@ void Ssl::Lock::lock()
     hFile = CreateFile(TEXT(filename.c_str()), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
     if (hFile == INVALID_HANDLE_VALUE)
 #else
-    fd = open(filename.c_str(), 0);
+    fd = open(filename.c_str(), O_RDWR);
     if (fd == -1)
 #endif
         throw std::runtime_error("Failed to open file " + filename);
@@ -58,7 +58,7 @@ void Ssl::Lock::lock()
 #if _SQUID_WINDOWS_
     if (!LockFile(hFile, 0, 0, 1, 0))
 #else
-    if (flock(fd, LOCK_EX) != 0)
+    if (lockf(fd, F_LOCK, 0) != 0)
 #endif
         throw std::runtime_error("Failed to get a lock of " + filename);
 }
@@ -73,7 +73,7 @@ void Ssl::Lock::unlock()
     }
 #else
     if (fd != -1) {
-        flock(fd, LOCK_UN);
+        lockf(fd, F_ULOCK, 0);
         close(fd);
         fd = -1;
     }