Fix racy bug in sbrk() (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 1 Dec 2016 18:22:46 +0000 (13:22 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 7 Dec 2016 22:46:48 +0000 (14:46 -0800)
The compiler would have caught that if we could build with Werror
without blowing up the toolchain build.  Need to track down all of those
errors.

I didn't have a bug that led to this - just happened to notice the
compiler warning due to an unrelated bug.

Rebuild glibc.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sbrk.c

index 3c696bb..d9ef39e 100644 (file)
@@ -40,14 +40,14 @@ static bool is_early_scp(void)
  * TLS for thread 0 yet, so we can't do things like check in_vcore_context(). */
 static void brk_lock(void)
 {
-       if (is_early_scp)
+       if (is_early_scp())
                return;
        __libc_lock_lock(__brk_lock);
 }
 
 static void brk_unlock(void)
 {
-       if (is_early_scp)
+       if (is_early_scp())
                return;
        __libc_lock_unlock(__brk_lock);
 }