Changeset 258
- Timestamp:
- Jun 10, 2009, 5:36:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/lib/replace/getifaddrs.c
r221 r258 262 262 struct ifaddrs *curif; 263 263 struct ifaddrs *lastif = NULL; 264 #ifdef __OS2__ 265 int total = 0; 266 #endif 264 267 265 268 *ifap = NULL; … … 288 291 289 292 if (ioctl(fd, SIOCGIFADDR, ifr) != 0) { 293 #ifndef __OS2__ 290 294 freeaddrinfo(*ifap); 291 295 return -1; 296 #else 297 goto next; 298 #endif 292 299 } 293 300 … … 307 314 308 315 if (ioctl(fd, SIOCGIFFLAGS, ifr) != 0) { 316 #ifndef __OS2__ 309 317 freeaddrinfo(*ifap); 310 318 return -1; 319 #else 320 goto next; 321 #endif 311 322 } 312 323 … … 314 325 315 326 if (ioctl(fd, SIOCGIFNETMASK, ifr) != 0) { 327 #ifndef __OS2__ 316 328 freeaddrinfo(*ifap); 317 329 return -1; 330 #else 331 goto next; 332 #endif 318 333 } 319 334 … … 321 336 322 337 lastif = curif; 338 total ++; 323 339 324 340 next: … … 339 355 340 356 close(fd); 357 #ifndef __OS2__ 341 358 return 0; 359 #else 360 if (total == 0) { 361 freeifaddrs(*ifap); 362 return -1; 363 } 364 #endif 342 365 } 343 366
Note:
See TracChangeset
for help on using the changeset viewer.