From cc83ec9ac1cf1ad60748fd3bb5114a6e6e471d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Thu, 4 Jul 2019 07:02:47 +0200 Subject: [PATCH] [___syscall5] debug messages --- lib/emscripten/src/syscalls/unix.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/emscripten/src/syscalls/unix.rs b/lib/emscripten/src/syscalls/unix.rs index 961e4227a..392919e8c 100644 --- a/lib/emscripten/src/syscalls/unix.rs +++ b/lib/emscripten/src/syscalls/unix.rs @@ -120,13 +120,12 @@ pub fn ___syscall5(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int let _path_str = unsafe { std::ffi::CStr::from_ptr(real_path).to_str().unwrap() }; let fd = unsafe { open(real_path, flags, mode) }; debug!( - "=> path: {}, flags: {}, mode: {} = fd: {}, last os error: {}", - _path_str, - flags, - mode, - fd, - Error::last_os_error(), + "=> path: {}, flags: {}, mode: {} = fd: {}", + _path_str, flags, mode, fd, ); + if fd == -1 { + debug!("=> last os error: {}", Error::last_os_error(),); + } fd }