Reduce nesting in sysv ipc code.