Fix windows build (#6774)
This commit is contained in:
		@@ -533,30 +533,32 @@ pub fn main() {
 | 
				
			|||||||
        option_env!("CI_COMMIT").unwrap_or("unknown")
 | 
					        option_env!("CI_COMMIT").unwrap_or("unknown")
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let default_logfile = format!(
 | 
					    let _log_redirect = {
 | 
				
			||||||
        "solana-validator-{}-{}.log",
 | 
					 | 
				
			||||||
        identity_keypair.pubkey(),
 | 
					 | 
				
			||||||
        chrono::Local::now().to_rfc3339()
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
    let logfile = matches.value_of("logfile").unwrap_or(&default_logfile);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    let _log_redirect = if logfile == "-" {
 | 
					 | 
				
			||||||
        None
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        #[cfg(unix)]
 | 
					        #[cfg(unix)]
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            println!("log file: {}", logfile);
 | 
					            let default_logfile = format!(
 | 
				
			||||||
            Some(gag::Redirect::stderr(File::create(logfile).unwrap_or_else(
 | 
					                "solana-validator-{}-{}.log",
 | 
				
			||||||
                |err| {
 | 
					                identity_keypair.pubkey(),
 | 
				
			||||||
                    eprintln!("Unable to create {}: {:?}", logfile, err);
 | 
					                chrono::Local::now().to_rfc3339()
 | 
				
			||||||
                    exit(1);
 | 
					            );
 | 
				
			||||||
                },
 | 
					            let logfile = matches.value_of("logfile").unwrap_or(&default_logfile);
 | 
				
			||||||
            )))
 | 
					
 | 
				
			||||||
 | 
					            if logfile == "-" {
 | 
				
			||||||
 | 
					                None
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                println!("log file: {}", logfile);
 | 
				
			||||||
 | 
					                Some(gag::Redirect::stderr(File::create(logfile).unwrap_or_else(
 | 
				
			||||||
 | 
					                    |err| {
 | 
				
			||||||
 | 
					                        eprintln!("Unable to create {}: {:?}", logfile, err);
 | 
				
			||||||
 | 
					                        exit(1);
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                )))
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #[cfg(not(unix))]
 | 
					        #[cfg(not(unix))]
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            println!("logging to a file is not supported on this platform");
 | 
					            println!("logging to a file is not supported on this platform");
 | 
				
			||||||
            None
 | 
					            ()
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user