X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpassfd.c;h=188c7d1bb716ae897c41f8d8aa17332a91aa10fa;hb=7a719c1772d45a9990560820a78ae76534ae3497;hp=a4d8841070153c37a5292515d68cf40dafabb448;hpb=e55355319eb5409871be533d7b9713328a8283db;p=gnulib.git diff --git a/lib/passfd.c b/lib/passfd.c index a4d884107..188c7d1bb 100644 --- a/lib/passfd.c +++ b/lib/passfd.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Free Software Foundation, Inc. +/* Copyright (C) 2011-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,12 @@ #include "cloexec.h" +/* The code that uses CMSG_FIRSTHDR is enabled on + Linux, MacOS X, FreeBSD, OpenBSD, NetBSD, AIX, OSF/1, Cygwin. + The code that uses HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS is enabled on + HP-UX, IRIX, Solaris. */ + +/* MSG_CMSG_CLOEXEC is defined only on Linux, as of 2011. */ #ifndef MSG_CMSG_CLOEXEC # define MSG_CMSG_CLOEXEC 0 #endif @@ -43,7 +49,7 @@ int sendfd (int sock, int fd) { - char send = 0; + char byte = 0; struct iovec iov; struct msghdr msg; # ifdef CMSG_FIRSTHDR @@ -53,7 +59,7 @@ sendfd (int sock, int fd) /* send at least one char */ memset (&msg, 0, sizeof msg); - iov.iov_base = &send; + iov.iov_base = &byte; iov.iov_len = 1; msg.msg_iov = &iov; msg.msg_iovlen = 1; @@ -100,7 +106,7 @@ sendfd (int sock _GL_UNUSED, int fd _GL_UNUSED) int recvfd (int sock, int flags) { - char recv = 0; + char byte = 0; struct iovec iov; struct msghdr msg; int fd = -1; @@ -118,7 +124,7 @@ recvfd (int sock, int flags) /* send at least one char */ memset (&msg, 0, sizeof msg); - iov.iov_base = &recv; + iov.iov_base = &byte; iov.iov_len = 1; msg.msg_iov = &iov; msg.msg_iovlen = 1;