Indent
authorRobert Swiecki <swiecki@google.com>
Tue, 8 Mar 2016 17:23:26 +0000 (18:23 +0100)
committerRobert Swiecki <swiecki@google.com>
Tue, 8 Mar 2016 17:23:26 +0000 (18:23 +0100)
common.h
net.c

index ca9534202eeba40bfd6b6a903120458d5778729e..a5b20871b7e64b82cf8b7bfdb7b2bf58678870b3 100644 (file)
--- a/common.h
+++ b/common.h
 #define _STRMERGE(a, b) a##b
 
 #ifdef __clang__
-  static void __attribute__((unused)) _clang_cleanup_func(void (^*dfunc)(void)) { (*dfunc)(); }
-  #define defer(a) void (^_STRMERGE(__df_, __COUNTER__))(void) __attribute__((cleanup(_clang_cleanup_func))) __attribute__((unused)) = ^{ a; }
+static void __attribute__ ((unused)) _clang_cleanup_func(void (^*dfunc) (void))
+{
+       (*dfunc) ();
+}
+
+#define defer(a) void (^_STRMERGE(__df_, __COUNTER__))(void) __attribute__((cleanup(_clang_cleanup_func))) __attribute__((unused)) = ^{ a; }
 #else
-  #define __block
-  #define defer(a) void _STRMERGE(_cleanup_func_, __LINE__)(void *_STRMERGE(_cleanup_unused_, __LINE__) __attribute__((unused))) { a; } ; int _STRMERGE(_cleanup_var_, __LINE__) __attribute__((cleanup(_STRMERGE(_cleanup_func_, __LINE__)))) __attribute__((unused))
+#define __block
+#define defer(a) void _STRMERGE(_cleanup_func_, __LINE__)(void *_STRMERGE(_cleanup_unused_, __LINE__) __attribute__((unused))) { a; } ; int _STRMERGE(_cleanup_var_, __LINE__) __attribute__((cleanup(_STRMERGE(_cleanup_func_, __LINE__)))) __attribute__((unused))
 #endif
 
-
 struct pids_t {
        pid_t pid;
        time_t start;
diff --git a/net.c b/net.c
index a41a4c6fc104375343326a20392260f6a7b14e27..2ff6400569f1d1c660ffc94b3da0236230a2be4b 100644 (file)
--- a/net.c
+++ b/net.c
@@ -327,7 +327,7 @@ static bool netIfaceUp(const char *ifacename)
                PLOG_E("socket(AF_INET, SOCK_STREAM, IPPROTO_IP)");
                return false;
        }
-        defer(close(sock));
+       defer(close(sock));
 
        struct ifreq ifr;
        memset(&ifr, '\0', sizeof(ifr));