Skip to content

Commit

Permalink
Merge pull request #103 from jodh-intel/cargo-audit-fixes
Browse files Browse the repository at this point in the history
cargo: Update dependencies identified by audit
  • Loading branch information
mxpv authored Nov 18, 2021
2 parents c96574c + 11e9406 commit 212d221
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description = "A Rust version of ttrpc."
protobuf = { version = "2.0", optional = true }
bytes = { version = "0.4.11", optional = true }
libc = { version = "0.2.59", features = [ "extra_traits" ] }
nix = "0.16.1"
nix = "0.20.2"
log = "0.4"
byteorder = "1.3.2"
thiserror = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ libc = "0.2.79"
byteorder = "1.3.2"
log = "0.4.6"
simple-logging = "2.0.2"
nix = "0.16.1"
nix = "0.20.2"
ttrpc = { path = "../", features = ["async"] }
ctrlc = { version = "3.0", features = ["termination"] }
tokio = { version = "1.0.1", features = ["signal", "time"] }
Expand Down
16 changes: 12 additions & 4 deletions src/sync/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

//! Sync server of ttrpc.
use nix::fcntl::OFlag;
use nix::sys::socket::{self, *};
use nix::unistd::*;
use protobuf::{CodedInputStream, Message};
Expand Down Expand Up @@ -330,9 +329,18 @@ impl Server {

self.listener_quit_flag.store(false, Ordering::SeqCst);

#[allow(deprecated)]
let (rfd, wfd) = pipe2(OFlag::O_CLOEXEC).unwrap();
self.monitor_fd = (rfd, wfd);
#[cfg(target_os = "linux")]
let fds = pipe2(nix::fcntl::OFlag::O_CLOEXEC)?;

#[cfg(not(target_os = "linux"))]
let fds = {
let (rfd, wfd) = pipe()?;
set_fd_close_exec(rfd)?;
set_fd_close_exec(wfd)?;
(rfd, wfd)
};

self.monitor_fd = fds;

let listener = self.listeners[0];

Expand Down
2 changes: 2 additions & 0 deletions ttrpc-codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
//!```
//!use ttrpc_codegen::Codegen;
//!use ttrpc_codegen::Customize;
//!# use std::path::Path;
//!
//!fn main() {
//!# let protos: Vec<&Path> = vec![];
//! Codegen::new()
//! .out_dir("protocols/sync")
//! .inputs(&protos)
Expand Down
2 changes: 1 addition & 1 deletion ttrpc-codegen/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ mod test {
"#;

let err = FileDescriptor::parse(msg).err().expect("err");
assert_eq!(4, err.line);
assert_eq!(3, err.line);
}

#[test]
Expand Down

0 comments on commit 212d221

Please sign in to comment.