Skip to content

Commit 1932ca6

Browse files
committed
fixup: change default filename to "<unknown>" and aother small updates
Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent 1b49eed commit 1932ca6

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/hyperlight_host/src/hypervisor/crashdump.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,15 @@ impl GuestView {
8484
})
8585
.collect();
8686

87-
// The filename and command line are set to null-terminated strings
8887
let filename = ctx
8988
.filename
90-
.clone()
91-
.map_or_else(|| "\0".to_string(), |s| format!("{}\0", s));
89+
.as_ref()
90+
.map_or_else(|| c"<unknown>".to_string(), |s| format!(c"{}", s));
9291

9392
let cmd = ctx
9493
.binary
95-
.clone()
96-
.map_or_else(|| "\0".to_string(), |s| format!("{}\0", s));
94+
.as_ref()
95+
.map_or_else(|| c"<unknown>".to_string(), |s| format!(c"{}", s));
9796

9897
// The xsave state is checked as it can be empty
9998
let mut components = vec![];

src/hyperlight_host/src/sandbox/uninitialized.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ impl UninitializedSandbox {
149149
GuestBinary::FilePath(binary_path) => {
150150
let path = Path::new(&binary_path)
151151
.canonicalize()
152-
.map_err(|e| new_error!("GuestBinary not found: '{}': {}", binary_path, e))?;
153-
let path = path
152+
.map_err(|e| new_error!("GuestBinary not found: '{}': {}", binary_path, e))?
154153
.into_os_string()
155154
.into_string()
156155
.map_err(|e| new_error!("Error converting OsString to String: {:?}", e))?;

0 commit comments

Comments
 (0)