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 */