From fecb67b246a2a2dad900edaab28f4e046ef47822 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 6 Feb 2008 16:54:01 +0000 Subject: Use a long int data type to handle getpid() result --- tests/server/sws.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/server/sws.c') diff --git a/tests/server/sws.c b/tests/server/sws.c index 0bbd124f3..695c6b156 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -670,7 +670,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) case DOCNUMBER_WERULEZ: /* we got a "friends?" question, reply back that we sure are */ logmsg("Identifying ourselves as friends"); - sprintf(msgbuf, "WE ROOLZ: %d\r\n", (int)getpid()); + sprintf(msgbuf, "WE ROOLZ: %ld\r\n", (long)getpid()); msglen = strlen(msgbuf); sprintf(weare, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\n\r\n%s", msglen, msgbuf); @@ -948,8 +948,10 @@ int main(int argc, char *argv[]) pidfile = fopen(pidname, "w"); if(pidfile) { - fprintf(pidfile, "%d\n", (int)getpid()); + long pid = (long)getpid(); + fprintf(pidfile, "%ld\n", pid); fclose(pidfile); + logmsg("Wrote pid %ld to %s", pid, pidname); } else { error = ERRNO; -- cgit v1.2.3