From 1a04b3c7ca26ef718c16b7b2e1d51fea29c12301 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Fri, 4 Jan 2019 17:34:17 -0800 Subject: Use libc provided sync function In order to flush file system level buffers to disk we use the sync function. The way we made this function known to the crate was by explicitly declaring it as extern "C" and linking against libc. However, given that we already (indirectly) depend on libc through the nitrokey crate (and that is unlikely to change) we may as well make libc a direct dependency and invoke the function through the crate. Given that the libc crate is available for a variety of platforms, it seems likely that its approach to interfacing with the system libc library is more portable than our hand rolled version. --- nitrocli/Cargo.lock | 1 + 1 file changed, 1 insertion(+) (limited to 'nitrocli/Cargo.lock') diff --git a/nitrocli/Cargo.lock b/nitrocli/Cargo.lock index abbf84d..ae75d07 100644 --- a/nitrocli/Cargo.lock +++ b/nitrocli/Cargo.lock @@ -54,6 +54,7 @@ name = "nitrocli" version = "0.2.0" dependencies = [ "argparse 0.2.2", + "libc 0.2.45", "nitrokey 0.2.3", ] -- cgit v1.2.1