MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / chdir_to_bindir

Function chdir_to_bindir

tests/test_crypto.cpp:826–844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

824}
825
826bool chdir_to_bindir()
827{
828#ifdef LINUX
829 char rgchPath[PATH_MAX], *pchPathTail;
830 memset(rgchPath, 0, sizeof(rgchPath));
831
832 if (readlink("/proc/self/exe", rgchPath, sizeof(rgchPath)) == -1)
833 return false;
834
835 pchPathTail = strrchr(rgchPath, '/');
836 if (!pchPathTail)
837 return false;
838
839 *pchPathTail = 0;
840 if (chdir(rgchPath) == -1)
841 return false;
842#endif
843 return true;
844}
845
846int main()
847{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected