comparison gtk3/dw.c @ 2904:2b7babf491e1

Solaris: Fix warning because getpid() returns a long int. Not sure if all versions return long or not... so cast to long just in case older versions return int.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 25 Dec 2022 08:38:46 +0000
parents 761b7a12b079
children 3fe7641f027c
comparison
equal deleted inserted replaced
2903:9fd16f694a77 2904:2b7babf491e1
2049 2049
2050 if(sysctl(name, 4, path, &length, NULL, 0) == -1 || length <= 1) 2050 if(sysctl(name, 4, path, &length, NULL, 0) == -1 || length <= 1)
2051 #elif defined(__sun__) 2051 #elif defined(__sun__)
2052 char procpath[101] = {0}; 2052 char procpath[101] = {0};
2053 2053
2054 snprintf(procpath, 100, "/proc/%d/path/a.out", getpid()); 2054 snprintf(procpath, 100, "/proc/%ld/path/a.out", (long)getpid());
2055 2055
2056 if(readlink(procpath, path, PATH_MAX) == -1) 2056 if(readlink(procpath, path, PATH_MAX) == -1)
2057 #endif 2057 #endif
2058 strncpy(path, arg ? arg : "", PATH_MAX); 2058 strncpy(path, arg ? arg : "", PATH_MAX);
2059 2059