1
0
forked from Proxmox/proxmox

sys: don't duplicate the template path

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-08-09 11:06:25 +02:00
parent 88731c52f0
commit 2d4050825d

@ -1,6 +1,5 @@
use std::ffi::OsString;
use std::os::fd::FromRawFd;
use std::os::unix::ffi::OsStrExt;
use std::os::unix::ffi::OsStringExt;
use std::os::unix::io::{AsRawFd, OwnedFd};
use std::path::{Path, PathBuf};
@ -205,7 +204,7 @@ pub fn make_tmp_dir<P: AsRef<Path>>(
) -> Result<PathBuf, Error> {
let template = directory.as_ref().join("tmp_XXXXXX");
let mut template = template.into_os_string().as_bytes().to_owned();
let mut template = template.into_os_string().into_vec();
// Push NULL byte so that we have a proper NULL-terminated string
template.push(0);