]> 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, 9 Jan 2015 10:27:12 +0000 (02:27 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 9 Jan 2015 10:27:12 +0000 (02:27 -0800)
src/ssl/certificate_db.cc

index 346fd2a4066cebee3bc5d3adf814f9e17bd4b66b..5d4e6cffd275190098fd4c57f4d0be6f95b3f177 100644 (file)
@@ -47,7 +47,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);
@@ -55,7 +55,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);
 }
@@ -70,7 +70,7 @@ void Ssl::Lock::unlock()
     }
 #else
     if (fd != -1) {
-        flock(fd, LOCK_UN);
+        lockf(fd, F_ULOCK, 0);
         close(fd);
         fd = -1;
     }