From 42df4cb7f6f3e8f3b4fc311eaa45f2c1b40de93d Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 22 Jun 2012 15:15:20 +0000 Subject: [PATCH] sunos: fix use of pid_t in format string --- src/unix/sunos.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/unix/sunos.c b/src/unix/sunos.c index 80724bf3..6246f616 100644 --- a/src/unix/sunos.c +++ b/src/unix/sunos.c @@ -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) @@ -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)