[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.
- [gnurl] 137/264: configure: remove use of -vec-report0 from CFLAGS with icc, (continued)
- [gnurl] 137/264: configure: remove use of -vec-report0 from CFLAGS with icc, gnunet, 2020/04/30
- [gnurl] 117/264: sockfilt: fix handling of ready closed sockets on Windows, gnunet, 2020/04/30
- [gnurl] 124/264: KNOWN_BUGS: fixed "USE_UNIX_SOCKETS on Windows", gnunet, 2020/04/30
- [gnurl] 154/264: CI/macos: convert CRLF to LF and align indentation, gnunet, 2020/04/30
- [gnurl] 152/264: server/resolve: remove AI_CANONNAME to make macos tell the truth, gnunet, 2020/04/30
- [gnurl] 213/264: tests/FILEFORMAT: converted to markdown and extended, gnunet, 2020/04/30
- [gnurl] 259/264: doh: Constify some input pointers, gnunet, 2020/04/30
- [gnurl] 161/264: release-notes.pl: detect the start of the references in cleanup mode, gnunet, 2020/04/30
- [gnurl] 214/264: mime: properly check Content-Type even if it has parameters, gnunet, 2020/04/30
- [gnurl] 164/264: tests: add Windows compatible pidwait like pidkill and pidterm, gnunet, 2020/04/30
- [gnurl] 166/264: tests/server/util.c: use curl_off_t instead of long for pid,
gnunet <=
- [gnurl] 167/264: compressed.d: stress that the headers are not modified, gnunet, 2020/04/30
- [gnurl] 165/264: tests: use Cygwin/msys PIDs for stunnel and sshd on Windows, gnunet, 2020/04/30
- [gnurl] 264/264: make gnurl-aux, gnunet, 2020/04/30
- [gnurl] 177/264: cirrus: no longer ignore test 504 which is working again, gnunet, 2020/04/30
- [gnurl] 180/264: tool: do not declare functions with Curl_ prefix, gnunet, 2020/04/30
- [gnurl] 229/264: http: free memory when Alt-Used header creation fails due to OOM, gnunet, 2020/04/30
- [gnurl] 162/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 157/264: sshserver.pl: use cached Win32 environment check variable, gnunet, 2020/04/30
- [gnurl] 175/264: test1908: avoid using fixed port number in test data, gnunet, 2020/04/30
- [gnurl] 183/264: tests: support hex encoded data and mqtt server, gnunet, 2020/04/30