perf tools: Move conditional O_CLOEXEC to util.h
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 22 Jan 2018 20:11:30 +0000 (17:11 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 23 Jan 2018 12:48:20 +0000 (09:48 -0300)
To be more generally available and get the build on centos:5 to
work after we use O_CLOEXEC in the next patch, in the util/dso.c file.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Wang YanQing <udknight@gmail.com>
Link: https://lkml.kernel.org/n/tip-vsjbiydh15pfqomxw1kx64ex@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/data.c
tools/perf/util/util.h

index 48094fde0a682c623dfdef6831dc45f92d9cd6e9..d8cfc19ddb1051e69b217801121f127c0b000bfc 100644 (file)
 #include "util.h"
 #include "debug.h"
 
-#ifndef O_CLOEXEC
-#ifdef __sparc__
-#define O_CLOEXEC      0x400000
-#elif defined(__alpha__) || defined(__hppa__)
-#define O_CLOEXEC      010000000
-#else
-#define O_CLOEXEC      02000000
-#endif
-#endif
-
 static bool check_pipe(struct perf_data *data)
 {
        struct stat st;
index 01434509c2e9850611c863825396ee62e54ff45d..9496365da3d74fb1e57839acc02e4322d5c9fea6 100644 (file)
@@ -68,4 +68,14 @@ extern bool perf_singlethreaded;
 void perf_set_singlethreaded(void);
 void perf_set_multithreaded(void);
 
+#ifndef O_CLOEXEC
+#ifdef __sparc__
+#define O_CLOEXEC      0x400000
+#elif defined(__alpha__) || defined(__hppa__)
+#define O_CLOEXEC      010000000
+#else
+#define O_CLOEXEC      02000000
+#endif
+#endif
+
 #endif /* GIT_COMPAT_UTIL_H */