mirror of
https://github.com/curl/curl.git
synced 2026-08-25 05:23:32 +03:00
tests: add the mqtt test server mqttd
This commit is contained in:
parent
675f5fb66f
commit
5e855bbd18
4 changed files with 1001 additions and 7 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -284,6 +284,20 @@ int write_pidfile(const char *filename)
|
|||
return 1; /* success */
|
||||
}
|
||||
|
||||
/* store the used port number in a file */
|
||||
int write_portfile(const char *filename, int port)
|
||||
{
|
||||
FILE *portfile = fopen(filename, "wb");
|
||||
if(!portfile) {
|
||||
logmsg("Couldn't write port file: %s %s", filename, strerror(errno));
|
||||
return 0; /* fail */
|
||||
}
|
||||
fprintf(portfile, "%d\n", port);
|
||||
fclose(portfile);
|
||||
logmsg("Wrote port %d to %s", port, filename);
|
||||
return 1; /* success */
|
||||
}
|
||||
|
||||
void set_advisor_read_lock(const char *filename)
|
||||
{
|
||||
FILE *lockfile;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue