comparison gtk/dw.c @ 2858:ecfbc48e933a

FreeBSD: Fix the executable path detection code on FreeBSD. I had used the wrong variable name when I wrote it on Linux.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 15 Nov 2022 10:32:42 +0000
parents 59106bf7f9f4
children b5cd3242b5e7
comparison
equal deleted inserted replaced
2857:59106bf7f9f4 2858:ecfbc48e933a
2105 if(readlink("/proc/self/exe", path, PATH_MAX) == -1) 2105 if(readlink("/proc/self/exe", path, PATH_MAX) == -1)
2106 #elif defined(__FreeBSD__) 2106 #elif defined(__FreeBSD__)
2107 int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; 2107 int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
2108 size_t length = PATH_MAX; 2108 size_t length = PATH_MAX;
2109 2109
2110 if(sysctl(name, 4, exe, &length, NULL, 0) == -1 || length <= 1) 2110 if(sysctl(name, 4, path, &length, NULL, 0) == -1 || length <= 1)
2111 #endif 2111 #endif
2112 strncpy(path, arg ? arg : "", PATH_MAX); 2112 strncpy(path, arg ? arg : "", PATH_MAX);
2113 2113
2114 if(path[0]) 2114 if(path[0])
2115 { 2115 {