]> granicus.if.org Git - pdns/commitdiff
Anders Kaseorg has fixed our semaphore code against returning EINTR, solving crashes...
authorBert Hubert <bert.hubert@netherlabs.nl>
Mon, 13 Dec 2010 20:30:15 +0000 (20:30 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Mon, 13 Dec 2010 20:30:15 +0000 (20:30 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1747 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/unix_semaphore.cc

index 90ac9338f04d9861607e5b6922a1a9ee4952dcf2..bad06dd695513f59fec654e1b26c3ee2bb995468 100644 (file)
@@ -156,7 +156,11 @@ int Semaphore::post()
 
 int Semaphore::wait()
 {
-  return sem_wait(m_pSemaphore);
+  int ret;
+  do
+    ret = sem_wait(m_pSemaphore);
+  while (ret == -1 && errno == EINTR);
+  return ret;
 }
 int Semaphore::tryWait()
 {