Browse Source

actually return 0 on success in io_passfd

master
Felix von Leitner 18 years ago
parent
commit
1213467cfe
  1. 2
      io/io_passfd.3
  2. 2
      io/io_passfd.c

2
io/io_passfd.3

@ -15,5 +15,7 @@ system).
The peer can then use io_receivefd(3) to receive the file descriptor.
Note that the passed descriptor stays open in the sending process.
.SH "RETURN VALUE"
io_passfd returns 0 on success, -1 on error (setting errno accordingly).
.SH "SEE ALSO"
io_receivefd(3)

2
io/io_passfd.c

@ -31,5 +31,5 @@ int io_passfd(int64 sock,int64 fd) {
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
*((int*)CMSG_DATA(cmsg))=fd;
msg.msg_controllen = cmsg->cmsg_len;
return sendmsg(sock,&msg,0);
return sendmsg(sock,&msg,0)>=0?0:-1;
}

Loading…
Cancel
Save