mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-01 00:46:38 +00:00
Merge pull request #5304 from liubin/fix/5299-delete-duplicated-get_bundle_path
kata-sys-util: delete duplicated get_bundle_path
This commit is contained in:
@@ -8,7 +8,7 @@ use std::ffi::OsString;
|
|||||||
use std::fs::{self, File};
|
use std::fs::{self, File};
|
||||||
use std::io::{Error, Result};
|
use std::io::{Error, Result};
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::Path;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
use crate::{eother, sl};
|
use crate::{eother, sl};
|
||||||
@@ -29,11 +29,6 @@ const FUSE_SUPER_MAGIC: FsType = 0x65735546;
|
|||||||
// from linux.git/include/uapi/linux/magic.h
|
// from linux.git/include/uapi/linux/magic.h
|
||||||
const OVERLAYFS_SUPER_MAGIC: FsType = 0x794c7630;
|
const OVERLAYFS_SUPER_MAGIC: FsType = 0x794c7630;
|
||||||
|
|
||||||
/// Get bundle path (current working directory).
|
|
||||||
pub fn get_bundle_path() -> Result<PathBuf> {
|
|
||||||
std::env::current_dir()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get the basename of the canonicalized path
|
/// Get the basename of the canonicalized path
|
||||||
pub fn get_base_name<P: AsRef<Path>>(src: P) -> Result<OsString> {
|
pub fn get_base_name<P: AsRef<Path>>(src: P) -> Result<OsString> {
|
||||||
let s = src.as_ref().canonicalize()?;
|
let s = src.as_ref().canonicalize()?;
|
||||||
|
Reference in New Issue
Block a user