mirror of
				https://github.com/Djeeberjr/fw-anwesenheit.git
				synced 2025-11-04 07:34:10 +00:00 
			
		
		
		
	pm3: don't inherit stdin
This commit is contained in:
		
							parent
							
								
									0617092f54
								
							
						
					
					
						commit
						9ca3d8384f
					
				@ -24,6 +24,8 @@ pub async fn run_pm3(tx: mpsc::Sender<String>) -> Result<(), Box<dyn Error>> {
 | 
			
		||||
        .arg("-c")
 | 
			
		||||
        .arg("lf hitag reader -@")
 | 
			
		||||
        .stdout(Stdio::piped())
 | 
			
		||||
        .stderr(Stdio::null())
 | 
			
		||||
        .stdin(Stdio::null())
 | 
			
		||||
        .spawn()?;
 | 
			
		||||
 | 
			
		||||
    let stdout = cmd.stdout.take().ok_or("Failed to get stdout")?;
 | 
			
		||||
@ -31,7 +33,7 @@ pub async fn run_pm3(tx: mpsc::Sender<String>) -> Result<(), Box<dyn Error>> {
 | 
			
		||||
    let mut reader = BufReader::new(stdout).lines();
 | 
			
		||||
 | 
			
		||||
    while let Some(line) = reader.next_line().await? {
 | 
			
		||||
        trace!("PM3: {}", line);
 | 
			
		||||
        trace!("PM3: {line}");
 | 
			
		||||
        if let Some(uid) = super::parser::parse_line(&line) {
 | 
			
		||||
            tx.send(uid).await?;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user