From 6a0b613dbc6a2c13e34c5b3641a22ef779d65747 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 2 May 2017 17:36:02 +0200
Subject: fix build, fix gcc2 parse errors


diff --git a/configure.ac b/configure.ac
index 540cb64..7457342 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,6 +141,7 @@ if test "$gtk" = "2" -o "$gtk" = "3"; then
 fi
 
 AC_SEARCH_LIBS([socket], [xnet])
+AC_CHECK_LIB([network], [socket])
 
 AS_IF([test "x$with_gssapi" != xno],
   [AC_SEARCH_LIBS(
@@ -185,7 +186,7 @@ AS_IF([test AS_VAR_GET(x_cv_linux_so_peercred) = yes],
 
 if test "x$GCC" = "xyes"; then
   :
-  AC_SUBST(WARNINGOPTS, ['-Wall -Werror'])
+  AC_SUBST(WARNINGOPTS, ['-Wall'])
 else
   :
   AC_SUBST(WARNINGOPTS, [])
diff --git a/unix/uxnet.c b/unix/uxnet.c
index 79f4fbc..8be48e2 100644
--- a/unix/uxnet.c
+++ b/unix/uxnet.c
@@ -1518,12 +1518,14 @@ static char *sk_tcp_peer_info(Socket sock)
             char uidbuf[64], gidbuf[64];
             sprintf(uidbuf, "%d", uid);
             sprintf(gidbuf, "%d", gid);
-            struct passwd *pw = getpwuid(uid);
+            {
+            	struct passwd *pw = getpwuid(uid);
             struct group *gr = getgrgid(gid);
             return dupprintf("pid %d (%s:%s)", pid,
                              pw ? pw->pw_name : uidbuf,
                              gr ? gr->gr_name : gidbuf);
         }
+        }
         return NULL;
     } else {
         return NULL;
diff --git a/unix/uxstore.c b/unix/uxstore.c
index 1580178..3666531 100644
--- a/unix/uxstore.c
+++ b/unix/uxstore.c
@@ -767,7 +767,8 @@ void write_random_seed(void *data, int len)
             sfree(fname);
             return;
         }
-        char *dir, *errmsg;
+        {
+        	char *dir, *errmsg;
 
 	dir = make_filename(INDEX_DIR, NULL);
         if ((errmsg = make_dir_path(dir, 0700)) != NULL) {
@@ -802,6 +803,7 @@ void write_random_seed(void *data, int len)
     close(fd);
     sfree(fname);
 }
+}
 
 void cleanup_all(void)
 {
-- 
2.7.0

