gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 166/264: tests/server/util.c: use curl_off_t instead of long for


From: gnunet
Subject: [gnurl] 166/264: tests/server/util.c: use curl_off_t instead of long for pid
Date: Thu, 30 Apr 2020 16:07:49 +0200

This is an automated email from the git hooks/post-receive script.

nikita pushed a commit to branch master
in repository gnurl.

commit dd0365d560aea5a1ad45b479636fb4fffddedace
Author: Marc Hoersken <address@hidden>
AuthorDate: Sat Apr 11 23:40:45 2020 +0200

    tests/server/util.c: use curl_off_t instead of long for pid
    
    Avoid potential overflow of huge PIDs on Windows.
    
    Related to #5188
    Assisted-by: Marcel Raad
---
 tests/server/util.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/server/util.c b/tests/server/util.c
index fa3d45118..24f9497ae 100644
--- a/tests/server/util.c
+++ b/tests/server/util.c
@@ -261,9 +261,9 @@ int wait_ms(int timeout_ms)
 int write_pidfile(const char *filename)
 {
   FILE *pidfile;
-  long pid;
+  curl_off_t pid;
 
-  pid = (long)getpid();
+  pid = (curl_off_t)getpid();
   pidfile = fopen(filename, "wb");
   if(!pidfile) {
     logmsg("Couldn't write pid file: %s %s", filename, strerror(errno));
@@ -278,7 +278,7 @@ int write_pidfile(const char *filename)
    */
   pid += 65536;
 #endif
-  fprintf(pidfile, "%ld\n", pid);
+  fprintf(pidfile, "%" CURL_FORMAT_CURL_OFF_T "\n", pid);
   fclose(pidfile);
   logmsg("Wrote pid %ld to %s", pid, filename);
   return 1; /* success */

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]