X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=compat_arch_x86.c;h=7d3b83af3c3949049f84f95267df1eb48687e311;hp=e882a4afe467f511832b4d4e662225b7fd41ca3a;hb=650b434b12597af49cad28c5c4b5faa3c98c04b0;hpb=8c43fe7257db4d2d75bbf06066d10a3a414f061e diff --git a/compat_arch_x86.c b/compat_arch_x86.c index e882a4a..7d3b83a 100644 --- a/compat_arch_x86.c +++ b/compat_arch_x86.c @@ -80,9 +80,9 @@ static void mutex_lock_signal_save(pthread_mutex_t *mutex, sigset_t *oldmask) int ret; /* Disable signals */ - ret = sigemptyset(&newmask); + ret = sigfillset(&newmask); assert(!ret); - ret = pthread_sigmask(SIG_SETMASK, &newmask, oldmask); + ret = pthread_sigmask(SIG_BLOCK, &newmask, oldmask); assert(!ret); ret = pthread_mutex_lock(&compat_mutex); assert(!ret); @@ -122,10 +122,11 @@ unsigned long _compat_uatomic_set(void *addr, unsigned long _new, int len) * generate an illegal instruction. Cannot catch this with * linker tricks when optimizations are disabled. */ + result = 0; __asm__ __volatile__("ud2"); } mutex_lock_signal_restore(&compat_mutex, &mask); - return _new; + return result; } unsigned long _compat_uatomic_xchg(void *addr, unsigned long _new, int len)