Revision 27ee9207

View differences:

net_helpers.c
119 119
}
120 120

  
121 121

  
122
char *default_ip_addr()
122
const char *hostname_ip_addr()
123 123
{
124
  char hostname[256];
125 124
  const char *ip;
125
  char hostname[256];
126 126
  struct addrinfo * result;
127 127
  struct addrinfo * res;
128 128
  int error;
129 129

  
130

  
131
  fprintf(stderr, "Trying to guess IP ...");
132 130
  if (gethostname(hostname, sizeof hostname) < 0) {
133 131
    fprintf(stderr, "can't get hostname\n");
134 132
    return NULL;
......
156 154
  }
157 155
  freeaddrinfo(result);
158 156

  
157
  return ip;
158
}
159

  
160
char *default_ip_addr()
161
{
162
  const char *ip = NULL;
163

  
164
  fprintf(stderr, "Trying to guess IP ...");
165

  
166
  ip = hostname_ip_addr();
167

  
159 168
  if (!ip) {
160 169
    ip = autodetect_ip_address();
161 170
  }

Also available in: Unified diff