Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
sunos: fix use of pid_t in format string
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Jun 22, 2012
1 parent 2a5ff05 commit 42df4cb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/unix/sunos.c
Expand Up @@ -75,7 +75,6 @@ uint64_t uv_hrtime() {
*/
int uv_exepath(char* buffer, size_t* size) {
ssize_t res;
pid_t pid;
char buf[128];

if (buffer == NULL)
Expand All @@ -84,8 +83,7 @@ int uv_exepath(char* buffer, size_t* size) {
if (size == NULL)
return (-1);

pid = getpid();
(void) snprintf(buf, sizeof (buf), "/proc/%d/path/a.out", pid);
(void) snprintf(buf, sizeof(buf), "/proc/%lu/path/a.out", (unsigned long) getpid());
res = readlink(buf, buffer, *size - 1);

if (res < 0)
Expand Down

0 comments on commit 42df4cb

Please sign in to comment.