]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/uipc_socket2.c
xnu-792.24.17.tar.gz
[apple/xnu.git] / bsd / kern / uipc_socket2.c
index ff81b933e723b7255b21630ef03f9fc6ec00d18c..51f753938da5b5a3813b41bfed4210711c93ddb5 100644 (file)
@@ -1456,9 +1456,14 @@ sbfree(struct sockbuf *sb, struct mbuf *m)
 int
 sblock(struct sockbuf *sb, int wf)
 {
-       return(sb->sb_flags & SB_LOCK ? 
-               ((wf == M_WAIT) ? sb_lock(sb) : EWOULDBLOCK) : 
-               (sb->sb_flags |= SB_LOCK), 0);
+       int error = 0;
+
+       if (sb->sb_flags & SB_LOCK)
+               error = (wf == M_WAIT) ? sb_lock(sb) : EWOULDBLOCK;
+       else
+               sb->sb_flags |= SB_LOCK;
+
+       return (error);
 }
 
 /* release lock on sockbuf sb */