]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/client/pxar_backup_stream.rs: use std::thread::Builder to name the thread
authorDietmar Maurer <dietmar@proxmox.com>
Sat, 18 Jan 2020 11:21:22 +0000 (12:21 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sat, 18 Jan 2020 11:21:22 +0000 (12:21 +0100)
To make debugging easier.

src/client/pxar_backup_stream.rs

index 4ec3bc3d74ee9ae0a20516d9ca4bb6779fc0a418..96aa5bb0805dc97bcc2b73fd3c999772a302809e 100644 (file)
@@ -61,7 +61,7 @@ impl PxarBackupStream {
 
         let catalog = catalog.clone();
         let exclude_pattern = Vec::new();
-        let child = thread::spawn(move || {
+        let child = std::thread::Builder::new().name("PxarBackupStream".to_string()).spawn(move || {
             let mut guard = catalog.lock().unwrap();
             let mut writer = unsafe { std::fs::File::from_raw_fd(tx) };
             if let Err(err) = pxar::Encoder::encode(
@@ -79,7 +79,7 @@ impl PxarBackupStream {
                 let mut error = error2.lock().unwrap();
                 *error = Some(err.to_string());
             }
-        });
+        })?;
 
         let pipe = unsafe { std::fs::File::from_raw_fd(rx) };
         let stream = crate::tools::wrapped_reader_stream::WrappedReaderStream::new(pipe);