summaryrefslogtreecommitdiff
path: root/src/get_ip_addr.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2009-07-21 20:26:53 +0200
committerMichael Stapelberg <michael@stapelberg.de>2009-07-21 20:26:53 +0200
commit230f3167b70b5d73b3d9c0c650c9a654c06ccb51 (patch)
treeffb0bd3f9abc4c5c9bd88c566ae5a08078662f17 /src/get_ip_addr.c
parent34ba9fa9083c655e5ba06cecd46da157eb07d980 (diff)
Add modelines and retab! all files
Diffstat (limited to 'src/get_ip_addr.c')
-rw-r--r--src/get_ip_addr.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/get_ip_addr.c b/src/get_ip_addr.c
index de03d8c..ba39a3d 100644
--- a/src/get_ip_addr.c
+++ b/src/get_ip_addr.c
@@ -1,3 +1,4 @@
+// vim:ts=8:expandtab
#include <net/if.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
@@ -32,11 +33,11 @@ const char *get_ip_addr(const char *interface) {
if (ioctl(general_socket, SIOCGIFADDR, &ifr) < 0)
return "no IP";
- int ret;
- if ((ret = getnameinfo(&ifr.ifr_addr, len, part, sizeof(part), NULL, 0, NI_NUMERICHOST)) != 0) {
- fprintf(stderr, "getnameinfo(): %s\n", gai_strerror(ret));
- return "no IP";
- }
+ int ret;
+ if ((ret = getnameinfo(&ifr.ifr_addr, len, part, sizeof(part), NULL, 0, NI_NUMERICHOST)) != 0) {
+ fprintf(stderr, "getnameinfo(): %s\n", gai_strerror(ret));
+ return "no IP";
+ }
return part;
}