comparison gtk4/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
1516 if(readlink("/proc/self/exe", path, PATH_MAX) == -1) 1516 if(readlink("/proc/self/exe", path, PATH_MAX) == -1)
1517 #elif defined(__FreeBSD__) 1517 #elif defined(__FreeBSD__)
1518 int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; 1518 int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
1519 size_t length = PATH_MAX; 1519 size_t length = PATH_MAX;
1520 1520
1521 if(sysctl(name, 4, exe, &length, NULL, 0) == -1 || length <= 1) 1521 if(sysctl(name, 4, path, &length, NULL, 0) == -1 || length <= 1)
1522 #endif 1522 #endif
1523 strncpy(path, arg ? arg : "", PATH_MAX); 1523 strncpy(path, arg ? arg : "", PATH_MAX);
1524 1524
1525 if(path[0]) 1525 if(path[0])
1526 { 1526 {