diff --context --recurs m:\bindrel/named/named-xfer.c m:\bind/named/named-xfer.c
*** m:\bindrel/named/named-xfer.c	Wed Jan 03 13:32:04 1996
--- m:\bind/named/named-xfer.c	Wed Jan 10 21:07:30 1996
***************
*** 408,417 ****
--- 460,486 ----
  	_res.options &= ~(RES_DEFNAMES | RES_DNSRCH | RES_RECURSE);
  	result = getzone(zp, serial_no, port);
  	(void) my_fclose(dbfp);
+ 
+     /* lgk add code to close ddtfile here */
+ #ifdef DEBUG
+ 	if (debug)
+       (void) my_fclose(ddt);
+ #endif
+ 
  	switch (result) {
  
  	case XFER_SUCCESS:			/* ok exit */
+ #ifndef WINNT
  		if (rename(tmpname, dbfile) == -1) {
+ #else /* lgk get rid of the ddt file if txfer ok in debug mode */
+ #ifdef DEBUG
+         if (debug)
+           (void) unlink(ddtfile);
+ #endif
+ 
+ 		/* C run time rename function under NT does not overwrite */
+ 		if(!MoveFileEx(tmpname, dbfile, MOVEFILE_REPLACE_EXISTING)) {
+ #endif
  			perror("rename");
  			if (!quiet)
  			    syslog(LOG_ERR, "rename %s to %s: %m",
***************
*** 420,442 ****
  		}
  		exit(XFER_SUCCESS);
  
  	case XFER_UPTODATE:		/* the zone was already uptodate */
  		(void) unlink(tmpname);
  		exit(XFER_UPTODATE);
  
  	case XFER_TIMEOUT:
  #ifdef DEBUG
  		if (!debug)
  #endif
! 		    (void) unlink(tmpname);
  		exit(XFER_TIMEOUT);	/* servers not reachable exit */
  
  	case XFER_FAIL:
  	default:
  #ifdef DEBUG
  		if (!debug)
! #endif
! 		    (void) unlink(tmpname);
  		exit(XFER_FAIL);	/* yuck exit */
  	}
  	/*NOTREACHED*/
--- 489,516 ----
  		}
  		exit(XFER_SUCCESS);
  
+ /* lgk add code to get rid of the ddt files if not in debug mode.. */
  	case XFER_UPTODATE:		/* the zone was already uptodate */
  		(void) unlink(tmpname);
+ #ifdef DEBUG
+         if (debug)
+           (void) unlink(ddtfile);
+ #endif
  		exit(XFER_UPTODATE);
  
  	case XFER_TIMEOUT:
  #ifdef DEBUG
  		if (!debug)
  #endif
! 		(void) unlink(tmpname);
  		exit(XFER_TIMEOUT);	/* servers not reachable exit */
  
  	case XFER_FAIL:
  	default:
  #ifdef DEBUG
  		if (!debug)
! #endif      
! 		(void) unlink(tmpname);
  		exit(XFER_FAIL);	/* yuck exit */
  	}
  	/*NOTREACHED*/
***************

