Skip to content

Instantly share code, notes, and snippets.

@rem7
Created February 7, 2012 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rem7/1762716 to your computer and use it in GitHub Desktop.
Save rem7/1762716 to your computer and use it in GitHub Desktop.
@@ -230,7 +230,12 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t
sa.sin_family = AF_INET;
sa.sin_port = htons(port);
- if (inet_pton(AF_INET, addr, &sa.sin_addr) == 0) {
+
+ // Windows XP does not support inet_pton so using
+ // inet_addr instead.
+ sa.sin_addr.S_un.S_addr = inet_addr(addr);
+ if( sa.sin_addr.S_un.S_addr == INADDR_ANY || sa.sin_addr.S_un.S_addr == INADDR_NONE) {
+ // if (inet_pton(AF_INET, addr, &sa.sin_addr) == 0) {
struct hostent *he;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment