From d2f946caf27adf4518cb657da39e296366d0b53f Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@chromium.org>
Date: Mon, 7 Dec 2015 21:46:13 -0500
Subject: [PATCH 2/6] use _DEFAULT_SOURCE for newer glibc

Newer versions of glibc have moved to _DEFAULT_SOURCE and away from
_BSD_SOURCE.  Trying to use the BSD define by itself leads to warnings
which causes build failures.

BRANCH=none
BUG=None
TEST=precq still works

Signed-off-by: Mike Frysinger <vapier@chromium.org>
Change-Id: Ice24b84dc6a540695fc7b76e8f22a4c85c301976
Reviewed-on: https://chromium-review.googlesource.com/316730
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
---
 util/ec_uartd.c | 3 ++-
 util/stm32mon.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/util/ec_uartd.c b/util/ec_uartd.c
index 82823c4..678932e 100644
--- a/util/ec_uartd.c
+++ b/util/ec_uartd.c
@@ -11,7 +11,8 @@
  */
 
 /* Force header files to define grantpt(), posix_openpt(), cfmakeraw() */
-#define _BSD_SOURCE
+#define _DEFAULT_SOURCE /* Newer glibc */
+#define _BSD_SOURCE     /* Older glibc */
 #define _XOPEN_SOURCE 600
 /* Force header file to declare ptsname_r(), etc. */
 #ifndef _GNU_SOURCE
diff --git a/util/stm32mon.c b/util/stm32mon.c
index 2de9400..ed1a7ee 100644
--- a/util/stm32mon.c
+++ b/util/stm32mon.c
@@ -13,7 +13,8 @@
  */
 
 /* use cfmakeraw() */
-#define _BSD_SOURCE
+#define _DEFAULT_SOURCE /* Newer glibc */
+#define _BSD_SOURCE     /* Older glibc */
 
 #include <arpa/inet.h>
 #include <errno.h>
-- 
2.9.0