- my $n = $send_cmd->($s1, $fds, freeze([$sub, @args]), MSG_EOR);
- return if defined($n);
- croak "sendmsg error: $!" if $! != EMSGSIZE;
+ my $buf = ipc_freeze([$sub, @args]);
+ my $n = $send_cmd->($s1, $fds, $buf, MSG_EOR);
+ return if defined($n); # likely
+ croak "sendmsg: $! (check RLIMIT_NOFILE)" if $!{ETOOMANYREFS};
+ croak "sendmsg: $!" if !$!{EMSGSIZE};