Przeglądaj źródła

Merge trunk revision 2524:
r2524 | sdake | 2009-10-14 12:06:37 -0700 (Wed, 14 Oct 2009) | 3 lines

Patch from jflesch to fix segfault when using sysv semaphores that the thread
state is checked prior to the semaphore operation, not after it has completed.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/branches/flatiron@2528 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 16 lat temu
rodzic
commit
4bf73a4528
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      exec/coroipcs.c

+ 1 - 1
exec/coroipcs.c

@@ -596,11 +596,11 @@ retry_semwait:
 		sop.sem_op = -1;
 		sop.sem_op = -1;
 		sop.sem_flg = 0;
 		sop.sem_flg = 0;
 retry_semop:
 retry_semop:
+		res = semop (conn_info->semid, &sop, 1);
 		if (ipc_thread_active (conn_info) == 0) {
 		if (ipc_thread_active (conn_info) == 0) {
 			coroipcs_refcount_dec (conn_info);
 			coroipcs_refcount_dec (conn_info);
 			pthread_exit (0);
 			pthread_exit (0);
 		}
 		}
-		res = semop (conn_info->semid, &sop, 1);
 		if ((res == -1) && (errno == EINTR || errno == EAGAIN)) {
 		if ((res == -1) && (errno == EINTR || errno == EAGAIN)) {
 			goto retry_semop;
 			goto retry_semop;
 		} else
 		} else