comparison gtk3/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
2045 if(readlink("/proc/self/exe", path, PATH_MAX) == -1) 2045 if(readlink("/proc/self/exe", path, PATH_MAX) == -1)
2046 #elif defined(__FreeBSD__) 2046 #elif defined(__FreeBSD__)
2047 int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; 2047 int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
2048 size_t length = PATH_MAX; 2048 size_t length = PATH_MAX;
2049 2049
2050 if(sysctl(name, 4, exe, &length, NULL, 0) == -1 || length <= 1) 2050 if(sysctl(name, 4, path, &length, NULL, 0) == -1 || length <= 1)
2051 #endif 2051 #endif
2052 strncpy(path, arg ? arg : "", PATH_MAX); 2052 strncpy(path, arg ? arg : "", PATH_MAX);
2053 2053
2054 if(path[0]) 2054 if(path[0])
2055 { 2055 {