--- rxvt-unicode/src/fdpass.C 2006/01/22 00:48:13 1.6 +++ rxvt-unicode/src/fdpass.C 2006/09/11 08:48:37 1.13 @@ -1,4 +1,7 @@ -/*--------------------------------*-C-*---------------------------------* +// This file is part of libptytty. Do not make local modifications. +// http://software.schmorp.de/pkg/libptytty + +/*----------------------------------------------------------------------* * File: fdpass.C *----------------------------------------------------------------------* * @@ -22,18 +25,20 @@ #include "../config.h" -#include +#include // needed by broken bsds for NULL used in sys/uio.h + #include +#include #include -#include "fdpass.h" +#include "libptytty.h" -#ifndef CMSG_LEN // CMSG_SPACe && CMSG_LEN are rfc2292 extensions to unix +#ifndef CMSG_LEN // CMSG_SPACE && CMSG_LEN are rfc2292 extensions to unix # define CMSG_LEN(len) (sizeof (cmsghdr) + len) #endif -int -ptytty_send_fd (int socket, int fd) +bool +ptytty::send_fd (int socket, int fd) { msghdr msg; iovec iov; @@ -59,11 +64,11 @@ msg.msg_controllen = cmsg->cmsg_len; - return sendmsg (socket, &msg, 0); + return sendmsg (socket, &msg, 0) >= 0; } int -ptytty_recv_fd (int socket) +ptytty::recv_fd (int socket) { msghdr msg; iovec iov;