dup2(*fdp, *fdp);
static int init_log_d(char *name, int *fdp){	int fd, nfd;	char converted_name[PATHLEN], *n;	struct tm *tp;	dup2(*fdp, *fdp);	if (name) {		n = name;		if (strchr(name, '%')) {			tp = localtime(&current_time);			if (tp) {				if (strftime(converted_name, PATHLEN - 1, name, tp))					n = converted_name;			}		}		fd = *fdp;		nfd = open(n, O_WRONLY | O_CREAT | O_APPEND, 0666);		if (nfd == -1)			return fd == -1 ? -1 : 0;		if (fd == -1)			*fdp = nfd;		else if (nfd != fd) {			dup2(nfd, fd);			close(nfd);			nfd = fd;		}		fcntl(nfd, F_SETFD, FD_CLOEXEC);	}	return 0;}