Mercurial > dwindows
comparison gtk/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 |
---|---|
2109 | 2109 |
2110 if(sysctl(name, 4, path, &length, NULL, 0) == -1 || length <= 1) | 2110 if(sysctl(name, 4, path, &length, NULL, 0) == -1 || length <= 1) |
2111 #elif defined(__sun__) | 2111 #elif defined(__sun__) |
2112 char procpath[101] = {0}; | 2112 char procpath[101] = {0}; |
2113 | 2113 |
2114 snprintf(procpath, 100, "/proc/%d/path/a.out", getpid()); | 2114 snprintf(procpath, 100, "/proc/%ld/path/a.out", (long)getpid()); |
2115 | 2115 |
2116 if(readlink(procpath, path, PATH_MAX) == -1) | 2116 if(readlink(procpath, path, PATH_MAX) == -1) |
2117 #endif | 2117 #endif |
2118 strncpy(path, arg ? arg : "", PATH_MAX); | 2118 strncpy(path, arg ? arg : "", PATH_MAX); |
2119 | 2119 |