From 3b8e82101d9f7f892a4a4499afe67a6675a78809 Mon Sep 17 00:00:00 2001 From: darealshinji Date: Sat, 3 Mar 2018 20:00:20 +0100 Subject: [PATCH] make ldconfig work on Debian --- checkrt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/checkrt.c b/checkrt.c index e62327b..7607d61 100644 --- a/checkrt.c +++ b/checkrt.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 djcj +/* Copyright (c) 2017-2018 djcj * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -64,7 +64,7 @@ void checkrt(char *usr_in_appdir) const char *format = "tr '\\0' '\\n' < '%s' | grep -e '%s' | tail -n1"; if (access(stdcxx_bundle_lib, F_OK) == 0) { - f = popen("ldconfig -p | grep 'libstdc++.so.6 (" LIBC6_ARCH ")' | awk 'NR==1{print $NF}'", "r"); + f = popen("PATH=\"/sbin:$PATH\" ldconfig -p | grep 'libstdc++.so.6 (" LIBC6_ARCH ")' | awk 'NR==1{print $NF}'", "r"); ret = fscanf(f, "%s", stdcxx_sys_lib); (void)ret; pclose(f); @@ -79,7 +79,7 @@ void checkrt(char *usr_in_appdir) } if (access(gcc_bundle_lib, F_OK) == 0) { - f = popen("ldconfig -p | grep 'libgcc_s.so.1 (" LIBC6_ARCH ")' | awk 'NR==1{print $NF}'", "r"); + f = popen("PATH=\"/sbin:$PATH\" ldconfig -p | grep 'libgcc_s.so.1 (" LIBC6_ARCH ")' | awk 'NR==1{print $NF}'", "r"); ret = fscanf(f, "%s", gcc_sys_lib); (void)ret; pclose(f);