Browse Source

actually return 0 on success in io_passfd

master
Felix von Leitner 17 years ago
parent
commit
1213467cfe
2 changed files with 3 additions and 1 deletions
  1. +2
    -0
      io/io_passfd.3
  2. +1
    -1
      io/io_passfd.c

+ 2
- 0
io/io_passfd.3 View File

@ -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)

+ 1
- 1
io/io_passfd.c View File

@ -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