diff --git a/pressure-vessel/adverb.c b/pressure-vessel/adverb.c
index 7a1e7a2017a4b836d2b8ff018dd2a03910e56e6c..f41541122eadf1fff07b167980511c0fe6aca05a 100644
--- a/pressure-vessel/adverb.c
+++ b/pressure-vessel/adverb.c
@@ -412,7 +412,7 @@ generate_locales (gchar **locpath_out,
                       &wait_status,
                       error);
 
-  if (pthread_sigmask (SIG_SETMASK, &old_mask, NULL) != 0)
+  if (pthread_sigmask (SIG_SETMASK, &old_mask, NULL) != 0 && ret)
     return glnx_throw_errno_prefix (error, "pthread_sigmask");
 
   if (!ret)