diff options
Diffstat (limited to 'sys_util/src/syslog.rs')
-rw-r--r-- | sys_util/src/syslog.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sys_util/src/syslog.rs b/sys_util/src/syslog.rs index 1a3e6ee..12996f8 100644 --- a/sys_util/src/syslog.rs +++ b/sys_util/src/syslog.rs @@ -38,9 +38,9 @@ use std::result; use std::str::from_utf8; use std::sync::{Mutex, MutexGuard, Once, ONCE_INIT}; -use libc::{tm, time, time_t, localtime_r, gethostname, c_char, syscall}; +use libc::{tm, time, time_t, localtime_r, gethostname, c_char}; -use syscall_defines::linux::LinuxSyscall::SYS_getpid; +use getpid; const SYSLOG_PATH: &'static str = "/dev/log"; @@ -293,13 +293,6 @@ fn send_buf(socket: &UnixDatagram, buf: &[u8]) { } } -// This bypasses libc's caching getpid() wrapper which can be invalid if a raw clone was used -// elsewhere. -fn getpid() -> i32 { - // Safe because this syscall can never fail and we give it a valid syscall number. - unsafe { syscall(SYS_getpid as i64) as i32 } -} - fn get_localtime() -> tm { unsafe { // Safe because tm is just a struct of plain data. |