summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Lewandowski <k.lewandowsk@samsung.com>2018-10-03 13:59:18 +0200
committerKarol Lewandowski <lmctl@lmctl.net>2018-11-07 23:43:39 +0100
commit236600bdad00d1f53b4221e0cac4a47bc64d1645 (patch)
tree0bb8c773045b17dd14f84da22a1048b7cdd3f57c
parent88120bf4a98462b41b5309017fc2ac0e332cb945 (diff)
downloadcrash-worker-236600bdad00d1f53b4221e0cac4a47bc64d1645.tar.gz
crash-worker-236600bdad00d1f53b4221e0cac4a47bc64d1645.tar.bz2
crash-worker-236600bdad00d1f53b4221e0cac4a47bc64d1645.zip
Define _GNU_SOURCE once for whole codebase
There is no need to repeat this in every file. Change-Id: Ia788840d819b8d72122296a5e5d64aa2a7c3cb40
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/crash-manager/crash-manager.c2
-rw-r--r--src/crash-manager/dbus_notify.c1
-rw-r--r--src/crash-stack/CMakeLists.txt2
-rw-r--r--src/crash-stack/crash-stack.c1
-rw-r--r--src/shared/util.c3
-rw-r--r--src/sys-assert/arm/backtrace.c2
-rw-r--r--src/sys-assert/arm_64/backtrace.c2
-rw-r--r--src/sys-assert/sys-assert.c1
-rw-r--r--src/sys-assert/x86/backtrace.c2
-rw-r--r--src/sys-assert/x86/context.c2
11 files changed, 6 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9834ed5..9f3222d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ PROJECT(crash-worker C)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
+ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE=1)
# Sub modules
ADD_SUBDIRECTORY(src/crash-manager)
diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c
index 95cbf8b..c48e29a 100644
--- a/src/crash-manager/crash-manager.c
+++ b/src/crash-manager/crash-manager.c
@@ -16,8 +16,6 @@
* limitations under the License.
*/
-#define _GNU_SOURCE
-
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
diff --git a/src/crash-manager/dbus_notify.c b/src/crash-manager/dbus_notify.c
index 6a8c5d8..cf78f6a 100644
--- a/src/crash-manager/dbus_notify.c
+++ b/src/crash-manager/dbus_notify.c
@@ -16,7 +16,6 @@
* Author: Mateusz Moscicki <m.moscicki2@partner.samsung.com>
*/
-#define _GNU_SOURCE
#include <gio/gio.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/src/crash-stack/CMakeLists.txt b/src/crash-stack/CMakeLists.txt
index fd26fac..f996da9 100644
--- a/src/crash-stack/CMakeLists.txt
+++ b/src/crash-stack/CMakeLists.txt
@@ -21,7 +21,7 @@ else()
set(CRASH_STACK_SRCS ${CRASH_STACK_SRCS} crash-stack-stub.c)
endif()
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIE -D_GNU_SOURCE=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIE")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
# Binary
diff --git a/src/crash-stack/crash-stack.c b/src/crash-stack/crash-stack.c
index a348067..00e2f3f 100644
--- a/src/crash-stack/crash-stack.c
+++ b/src/crash-stack/crash-stack.c
@@ -17,7 +17,6 @@
* Łukasz Stelmach <l.stelmach@samsung.com>
* Rafał Pietruch <r.pietruch@samsung.com>
*/
-#define _GNU_SOURCE 1
/**
* @file crash-stack.c
diff --git a/src/shared/util.c b/src/shared/util.c
index 2367524..775d6be 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -14,9 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
diff --git a/src/sys-assert/arm/backtrace.c b/src/sys-assert/arm/backtrace.c
index 7520bba..2d1241a 100644
--- a/src/sys-assert/arm/backtrace.c
+++ b/src/sys-assert/arm/backtrace.c
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define _GNU_SOURCE
+
#include <stdlib.h>
#include <stdio.h>
#include <ucontext.h>
diff --git a/src/sys-assert/arm_64/backtrace.c b/src/sys-assert/arm_64/backtrace.c
index 3c8f560..21a10d4 100644
--- a/src/sys-assert/arm_64/backtrace.c
+++ b/src/sys-assert/arm_64/backtrace.c
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define _GNU_SOURCE
+
#include <stdlib.h>
#include <stdio.h>
#include <ucontext.h>
diff --git a/src/sys-assert/sys-assert.c b/src/sys-assert/sys-assert.c
index 75c7c3b..5af44ff 100644
--- a/src/sys-assert/sys-assert.c
+++ b/src/sys-assert/sys-assert.c
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/sys-assert/x86/backtrace.c b/src/sys-assert/x86/backtrace.c
index 0453bbb..4c07d86 100644
--- a/src/sys-assert/x86/backtrace.c
+++ b/src/sys-assert/x86/backtrace.c
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define _GNU_SOURCE
+
#include <stdlib.h>
#include <stdio.h>
#include <execinfo.h>
diff --git a/src/sys-assert/x86/context.c b/src/sys-assert/x86/context.c
index 5644d15..313ad86 100644
--- a/src/sys-assert/x86/context.c
+++ b/src/sys-assert/x86/context.c
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define _GNU_SOURCE
+
#include <stdlib.h>
#include <stdio.h>
#include <ucontext.h>