]> code.delx.au - pulseaudio/blobdiff - src/pulse/fork-detect.c
core: Fix uninit pointer read in protocol-native
[pulseaudio] / src / pulse / fork-detect.c
index f10fc029800f5b31ba88a0e262be72ea60c9b717..0ebc3864afcfb98590f9ab514a16c35dca56e88c 100644 (file)
@@ -39,21 +39,21 @@ int pa_detect_fork(void) {
      * however have to deal with this cleanly, so we try to detect the
      * forks making sure all our calls fail cleanly after the fork. */
 
-    pa_assert(sizeof(pa_atomic_t) >= sizeof(pid_t));
+    pa_assert_cc(sizeof(pa_atomic_t) >= sizeof(pid_t));
 
     for (;;) {
         pid_t stored_pid = (pid_t) pa_atomic_load(&pid);
 
         /* First let's check whether the current pid matches the stored one */
         if (stored_pid == getpid())
-            return FALSE;
+            return false;
 
         /* Does it contain a different PID than ours? Then the process got forked. */
         if ((int) stored_pid != (int) -1)
-            return TRUE;
+            return true;
 
         /* Ok, it still contains no PID, then store it */
         if (pa_atomic_cmpxchg(&pid, (int) -1, (int) getpid()))
-            return FALSE;
+            return false;
     }
 }