From 01090905d0dd82c325655143b70385843740bd1b Mon Sep 17 00:00:00 2001 From: Putta Khunchalee Date: Fri, 15 Nov 2024 22:12:50 +0700 Subject: [PATCH] Writes path length --- dumper/src/main.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dumper/src/main.rs b/dumper/src/main.rs index 5d96cb7..6e9ca63 100644 --- a/dumper/src/main.rs +++ b/dumper/src/main.rs @@ -226,14 +226,12 @@ unsafe fn dump_mount(k: K, fd: c_int, mp: *mut K::Mount, lock: MtxLoc }; // Write type and path. - if !p.path.is_empty() { - if !write_dump(k, fd, &[ty.into()]) { - return false; - } + if !write_dump(k, fd, &[ty.into()]) { + return false; + } - if !write_dump(k, fd, &p.path) { - return false; - } + if !write_dump(k, fd, &p.path.len().to_le_bytes()) || !write_dump(k, fd, &p.path) { + return false; } // Dump.