42-archive/42sh/libft/src/sys/fd_replace.c
2017-03-21 16:41:00 +01:00

20 lines
1,013 B
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fd_replace.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/21 16:32:26 by jhalford #+# #+# */
/* Updated: 2017/03/21 16:40:17 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int fd_replace(int fd1, int fd2)
{
if (fd1 != fd2)
return(dup2_close(fd1, fd2));
return (0);
}