intercept: Use private file exists function to strip nica API from exposed ABI

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
Ikey Doherty
2017-10-12 02:20:38 +01:00
parent 191ea02946
commit 2cf5db42b3
+10 -3
View File
@@ -14,9 +14,16 @@
#include <link.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#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)) {