예제 #1
0
파일: wrapped.c 프로젝트: hynnet/ralink_sdk
int dup2(int oldfd, int newfd)
{
    if (smbw_fd(newfd)) {
        close(newfd);
    }

    if (smbw_fd(oldfd)) {
        return smbw_dup2(oldfd, newfd);
    }

    return real_dup2(oldfd, newfd);
}
예제 #2
0
파일: wrapper.c 프로젝트: AllardJ/Tomato
int dup2(int oldfd, int newfd)
{
        check_init("dup2");
        
	if (smbw_fd(newfd)) {
		(* smbw_libc.close)(newfd);
	}
        
	if (smbw_fd(oldfd)) {
		return smbw_dup2(oldfd, newfd);
	}
        
        return (* smbw_libc.dup2)(oldfd, newfd);
}