[Forensics-changes] [yara] 372/415: Fix bug in semaphore_init introduced in ce480357eded31db348c7ba52fa889d0d2aa21d8

Hilko Bengen bengen at moszumanska.debian.org
Thu Apr 3 05:43:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository yara.

commit 2497e20ba67f4436dfa0d927d05ef143f72034c6
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Mon Jan 20 23:30:03 2014 +0100

    Fix bug in semaphore_init introduced in ce480357eded31db348c7ba52fa889d0d2aa21d8
---
 threading.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/threading.c b/threading.c
index 2f394b7..8af9803 100644
--- a/threading.c
+++ b/threading.c
@@ -78,8 +78,6 @@ int semaphore_init(
   *semaphore = CreateSemaphore(NULL, value, 65535, NULL);
   if (*semaphore == NULL)
     return GetLastError();
-  else
-    return 0;
   #else
   // Mac OS X doesn't support unnamed semaphores via sem_init, that's why
   // we use sem_open instead sem_init and immediately unlink the semaphore
@@ -87,13 +85,15 @@ int semaphore_init(
   //
   // http://stackoverflow.com/questions/1413785/sem-init-on-os-x
   *semaphore = sem_open("/semaphore", O_CREAT, S_IRUSR, value);
+
   if (*semaphore == SEM_FAILED)
     return errno;
-  else
-    return 0;
+
   if (sem_unlink("/semaphore") != 0)
     return errno;
   #endif
+
+  return 0;
 }
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list