File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1544,9 +1544,16 @@ do_change_comment(struct passwd *pw)
1544
1544
fd = open (identity_file , O_WRONLY | O_CREAT | O_TRUNC , 0644 );
1545
1545
if (fd == -1 )
1546
1546
fatal ("Could not save your public key in %s" , identity_file );
1547
+ #ifdef WINDOWS
1548
+ /* Windows POSIX adpater does not support fdopen() on open(file)*/
1549
+ close (fd );
1550
+ if ((f = fopen (identity_file , "w" )) == NULL )
1551
+ fatal ("fopen %s failed: %s" , identity_file , strerror (errno ));
1552
+ #else /* !WINDOWS */
1547
1553
f = fdopen (fd , "w" );
1548
1554
if (f == NULL )
1549
1555
fatal ("fdopen %s failed: %s" , identity_file , strerror (errno ));
1556
+ #endif /* !WINDOWS */
1550
1557
if ((r = sshkey_write (public , f )) != 0 )
1551
1558
fatal ("write key failed: %s" , ssh_err (r ));
1552
1559
sshkey_free (public );
You can’t perform that action at this time.
0 commit comments