@@ -1039,7 +1039,6 @@ privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
1039
1039
close (pmonitor -> m_log_sendfd );
1040
1040
pmonitor -> m_log_sendfd = PRIVSEP_LOG_FD ;
1041
1041
fcntl (pmonitor -> m_log_sendfd , F_SETFD , FD_CLOEXEC );
1042
-
1043
1042
/* Arrange for logging to be sent to the monitor */
1044
1043
set_log_handler (mm_log_handler , pmonitor );
1045
1044
#endif
@@ -1453,7 +1452,11 @@ main(int ac, char **av)
1453
1452
struct ssh * ssh = NULL ;
1454
1453
extern char * optarg ;
1455
1454
extern int optind ;
1455
+ #ifdef WINDOWS
1456
+ int r , opt , on = 1 , remote_port ;
1457
+ #else
1456
1458
int devnull , r , opt , on = 1 , remote_port ;
1459
+ #endif /* WINDOWS */
1457
1460
int sock_in = -1 , sock_out = -1 , rexeced_flag = 0 , have_key = 0 ;
1458
1461
const char * remote_ip , * rdomain ;
1459
1462
char * line , * laddr , * logfile = NULL ;
@@ -1645,15 +1648,15 @@ main(int ac, char **av)
1645
1648
#endif /* WINDOWS */
1646
1649
1647
1650
platform_pre_session_start ();
1648
-
1651
+ #ifndef WINDOWS
1649
1652
/* Reserve fds we'll need later for reexec things */
1650
1653
if ((devnull = open (_PATH_DEVNULL , O_RDWR )) == -1 )
1651
1654
fatal ("open %s: %s" , _PATH_DEVNULL , strerror (errno ));
1652
1655
while (devnull < PRIVSEP_MIN_FREE_FD ) {
1653
1656
if ((devnull = dup (devnull )) == -1 )
1654
1657
fatal ("dup %s: %s" , _PATH_DEVNULL , strerror (errno ));
1655
1658
}
1656
-
1659
+ #endif /* !WINDOWS */
1657
1660
seed_rng ();
1658
1661
1659
1662
/* If requested, redirect the logs to the specified logfile. */
@@ -1732,10 +1735,11 @@ main(int ac, char **av)
1732
1735
*/
1733
1736
(void )atomicio (vwrite , startup_pipe , "\0" , 1 );
1734
1737
}
1738
+ #ifndef WINDOWS
1735
1739
/* close the fd, but keep the slot reserved */
1736
1740
if (dup2 (devnull , REEXEC_CONFIG_PASS_FD ) == -1 )
1737
1741
fatal ("dup2 devnull->config fd: %s" , strerror (errno ));
1738
-
1742
+ #endif /* !WINDOWS */
1739
1743
/* Check that options are sensible */
1740
1744
if (options .authorized_keys_command_user == NULL &&
1741
1745
(options .authorized_keys_command != NULL &&
0 commit comments