From 2cf5db42b3fafb0ca74f4c70d3087af474c4e815 Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Thu, 12 Oct 2017 02:20:38 +0100 Subject: [PATCH] intercept: Use private file exists function to strip nica API from exposed ABI Signed-off-by: Ikey Doherty --- src/intercept/main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/intercept/main.c b/src/intercept/main.c index 301b661..4b34fe7 100644 --- a/src/intercept/main.c +++ b/src/intercept/main.c @@ -14,9 +14,16 @@ #include #include #include +#include #include "../common.h" -#include "nica/nica.h" +#include "nica/util.h" + +static inline bool lsi_file_exists(const char *path) +{ + struct stat st = { .st_ino = 0 }; + return (lstat(path, &st) == 0); +} /** * What's the known process name? @@ -193,7 +200,7 @@ static void emit_overriden_lib(const char *lib_name) char *lsi_search_steam(const char *name) { /* Find out if it exists */ - bool file_exists = nc_file_exists(name); + bool file_exists = lsi_file_exists(name); /* Find out if its a Steam private lib.. These are relative "./" files too! */ if (name && (strstr(name, "/Steam/") || strncmp(name, "./", 2) == 0)) { @@ -216,7 +223,7 @@ char *lsi_search_steam(const char *name) char *lsi_blacklist_vendor(const char *name) { /* Find out if it exists */ - bool file_exists = nc_file_exists(name); + bool file_exists = lsi_file_exists(name); /* Find out if its a Steam private lib.. These are relative "./" files too! */ if (name && (strstr(name, "/Steam/") || strncmp(name, "./", 2) == 0)) {