From feddb899d44dbdee35f149eb9d3655c399a4340e Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Tue, 14 Oct 2014 14:38:24 +0200
Subject: Search for gethostbyname in libnetwork.


diff --git a/configure.ac b/configure.ac
index 2132256..95983b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,8 @@ AC_CHECK_TYPE(gid_t, int)
 AC_HEADER_STDC
 AC_HEADER_DIRENT
 
+AC_SEARCH_LIBS(gethostbyname, [socket, network])
+
 AC_CHECK_FUNCS([fchmod fchown])
 # This is needed for mingw build
 AC_CHECK_FUNCS([setmode getpwuid getpwnam getgrgid getgrnam pipe fork getuid geteuid])
-- 
2.23.0


From 5ff823bec064715a32a60dc0ea46e17990f9def0 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Tue, 14 Oct 2014 14:38:58 +0200
Subject: gcc2 fixes.


diff --git a/gnu/parse-datetime.y b/gnu/parse-datetime.y
index a474312..7d57358 100644
--- a/gnu/parse-datetime.y
+++ b/gnu/parse-datetime.y
@@ -2095,7 +2095,7 @@ parse_datetime2 (struct timespec *result, char const *p,
                 dbg_printf (_("warning: when adding relative days, "    \
                               "it is recommended to specify 12:00pm\n"));
             }
-
+		{
           int year = tm.tm_year + pc.rel.year;
           int month = tm.tm_mon + pc.rel.month;
           int day = tm.tm_mday + pc.rel.day;
@@ -2112,6 +2112,7 @@ parse_datetime2 (struct timespec *result, char const *p,
           tm.tm_year = year;
           tm.tm_mon = month;
           tm.tm_mday = day;
+		}
           tm.tm_hour = tm0.tm_hour;
           tm.tm_min = tm0.tm_min;
           tm.tm_sec = tm0.tm_sec;
@@ -2272,14 +2273,17 @@ parse_datetime2 (struct timespec *result, char const *p,
 
           dbg_printf (_("final: %ld.%09ld (epoch-seconds)\n"),
                       result->tv_sec,result->tv_nsec);
-
+{
           struct tm const *gmt = gmtime (&result->tv_sec);
           dbg_printf (_("final: %s (UTC0)\n"),
                       debug_strfdatetime (gmt, NULL, dbg_tm, sizeof (dbg_tm)));
+}
+{
           struct tm const *lmt = localtime (&result->tv_sec);
           dbg_printf (_("final: %s (output timezone TZ=%+03d:%02d)\n"),
                       debug_strfdatetime (lmt, NULL, dbg_tm, sizeof (dbg_tm)),
                       (int)(otz/60), abs ((int)otz)%60);
+}
         }
     }
 
diff --git a/src/makepath.c b/src/makepath.c
index f937166..b552a48 100644
--- a/src/makepath.c
+++ b/src/makepath.c
@@ -66,10 +66,10 @@ make_path (char const *argpath,
 
   if (stat (dirpath, &stats))
     {
+      char *slash = dirpath;
       tmpmode = MODE_RWX & ~ newdir_umask;
       invert_permissions = we_are_root ? 0 : MODE_WXUSR & ~ tmpmode;
 
-      char *slash = dirpath;
       while (*slash == '/')
 	slash++;
       while ((slash = strchr (slash, '/')))
-- 
2.23.0

