diff --git a/src/common/env.c b/src/common/env.c
index 0d84a4f0b4edb53e72b19c66a330259d52b8dcb2..0f7d237e379fdcaa7f6c3d5cd1046b2181297ed6 100644
--- a/src/common/env.c
+++ b/src/common/env.c
@@ -678,8 +678,8 @@ int setup_env(env_t *env, bool preserve_env)
 		}
 	}
 
-	if ((cluster_flags & CLUSTER_FLAG_BG)
-	    || (cluster_flags & CLUSTER_FLAG_CRAYXT)) {
+	if (!(cluster_flags & CLUSTER_FLAG_BG)
+	    && !(cluster_flags & CLUSTER_FLAG_CRAYXT)) {
 		/* These aren't relavant to a system not using Slurm
 		   as the launcher.  Since there isn't a flag for that
 		   we check for the flags we do have.