Re: [PATCH 1/6] Add API for duplicating a socket/client file descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/15/2011 01:58 AM, Jiri Denemark wrote:
@@ -710,6 +711,23 @@ int virNetSocketGetFD(virNetSocketPtr sock)
  }


+int virNetSocketDupFD(virNetSocketPtr sock, bool cloexec)
+{
+    int fd;
+
+    if (cloexec)
+        fd = fcntl(sock->fd, F_DUPFD_CLOEXEC, (long) 0);

The third argument is unneeded, and skipping it will avoid a stupid-looking cast. But leaving it doesn't hurt either, if you already pushed.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]