mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 09:33:39 +01:00
Networking: support Windows
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#define FF_PUBLICIP_MODULE_NAME "Public IP"
|
||||
#define FF_PUBLICIP_NUM_FORMAT_ARGS 1
|
||||
|
||||
static int sockfd;
|
||||
static FFSockType sockfd;
|
||||
|
||||
void ffPreparePublicIp(FFinstance* instance)
|
||||
{
|
||||
@@ -39,7 +39,7 @@ void ffPrintPublicIp(FFinstance* instance)
|
||||
if(sockfd == 0)
|
||||
ffPreparePublicIp(instance);
|
||||
|
||||
if(sockfd < 0)
|
||||
if(sockfd == INVALID_SOCKET)
|
||||
{
|
||||
ffPrintError(instance, FF_PUBLICIP_MODULE_NAME, 0, &instance->config.publicIP, "Failed to connect to an IP detection server");
|
||||
return;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#define FF_WEATHER_MODULE_NAME "Weather"
|
||||
#define FF_WEATHER_NUM_FORMAT_ARGS 1
|
||||
|
||||
static int sockfd;
|
||||
static FFSockType sockfd;
|
||||
|
||||
void ffPrepareWeather(FFinstance* instance)
|
||||
{
|
||||
@@ -21,7 +21,7 @@ void ffPrintWeather(FFinstance* instance)
|
||||
if(sockfd == 0)
|
||||
ffPrepareWeather(instance);
|
||||
|
||||
if(sockfd < 0)
|
||||
if(sockfd == INVALID_SOCKET)
|
||||
{
|
||||
ffPrintError(instance, FF_WEATHER_MODULE_NAME, 0, &instance->config.weather, "Failed to connect to 'wttr.in'");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user