ucspi-ssl  0.99e
TLS encryption for IPv6 communication
fd_copy.c
Go to the documentation of this file.
1 /* Public domain. */
2 
3 #include <unistd.h>
4 #include <fcntl.h>
5 #include "fd.h"
6 
7 int fd_copy(int to,int from)
8 {
9  if (to == from) return 0;
10  if (fcntl(from,F_GETFL,0) == -1) return -1;
11  close(to);
12  if (fcntl(from,F_DUPFD,to) == -1) return -1;
13  return 0;
14 }
int fd_copy(int to, int from)
Definition: fd_copy.c:7