third-party libs
This commit is contained in:
parent
f836927d3a
commit
b154ee9266
3667 changed files with 854591 additions and 0 deletions
26
third-party/curl-7.21.4/tests/libtest/chkhostname.c
vendored
Normal file
26
third-party/curl-7.21.4/tests/libtest/chkhostname.c
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include "setup.h"
|
||||
|
||||
#include "curl_gethostname.h"
|
||||
|
||||
#define HOSTNAME_MAX 1024
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char buff[HOSTNAME_MAX];
|
||||
if (argc != 2) {
|
||||
printf("Usage: %s EXPECTED_HOSTNAME\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (Curl_gethostname(buff, HOSTNAME_MAX)) {
|
||||
printf("Curl_gethostname() failed\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* compare the name returned by Curl_gethostname() with the expected one */
|
||||
if(strncmp(buff, argv[1], HOSTNAME_MAX)) {
|
||||
printf("got unexpected host name back, LD_PRELOAD failed\n");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue