mirror of
https://github.com/curl/curl.git
synced 2026-08-24 23:23:32 +03:00
Use a long int data type to handle getpid() result
This commit is contained in:
parent
2c0956200f
commit
fecb67b246
3 changed files with 15 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue