[CRIU] [PATCH 2/3] arm/test: fix _XOPEN_SOURCE define

Dmitry Safonov dsafonov at virtuozzo.com
Tue Aug 30 06:18:33 PDT 2016


From: Dmitry Safonov <0x7f454c46 at gmail.com>

It looks like, on arm32 in <features.h>:
  #ifdef  _XOPEN_SOURCE
  # define __USE_XOPEN    1
  # if (_XOPEN_SOURCE - 0) >= 500
  #  define __USE_XOPEN_EXTENDED  1
  /* ... */


And ptsname(), unlockpt(), grantpt() are under:
  #ifdef __USE_XOPEN_EXTENDED
  extern int grantpt (int __fd) __THROW;
  extern int unlockpt (int __fd) __THROW;
  extern char *ptsname (int __fd) __THROW __wur;
  #endif
  /* ... */

Fixes:
pty00.c:50:2: error: implicit declaration of function 'grantpt' [-Werror=implicit-function-declaration]
  grantpt(fdm);
  ^~~~~~~
pty00.c:51:2: error: implicit declaration of function 'unlockpt' [-Werror=implicit-function-declaration]
  unlockpt(fdm);
  ^~~~~~~~
pty00.c:52:14: error: implicit declaration of function 'ptsname' [-Werror=implicit-function-declaration]
  slavename = ptsname(fdm);
              ^~~~~~~
pty00.c:52:12: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
  slavename = ptsname(fdm);
            ^

Signed-off-by: Dmitry Safonov <0x7f454c46 at gmail.com>
---
 test/zdtm/static/pty00.c | 2 +-
 test/zdtm/static/pty01.c | 2 +-
 test/zdtm/static/pty02.c | 2 +-
 test/zdtm/static/pty03.c | 2 +-
 test/zdtm/static/pty04.c | 2 +-
 test/zdtm/static/tty00.c | 2 +-
 test/zdtm/static/tty02.c | 2 +-
 test/zdtm/static/tty03.c | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/test/zdtm/static/pty00.c b/test/zdtm/static/pty00.c
index 8d4a0f9976c7..9e4f452323b4 100644
--- a/test/zdtm/static/pty00.c
+++ b/test/zdtm/static/pty00.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
 #include <stdlib.h>
 #include "zdtmtst.h"
 #include <sys/types.h>
diff --git a/test/zdtm/static/pty01.c b/test/zdtm/static/pty01.c
index 46710e280bca..ab1f92da6c2a 100644
--- a/test/zdtm/static/pty01.c
+++ b/test/zdtm/static/pty01.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
 #include <stdlib.h>
 #include "zdtmtst.h"
 #include <sys/types.h>
diff --git a/test/zdtm/static/pty02.c b/test/zdtm/static/pty02.c
index 0074bbd8d7e9..041a4e4be838 100644
--- a/test/zdtm/static/pty02.c
+++ b/test/zdtm/static/pty02.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
 #include <stdlib.h>
 #include "zdtmtst.h"
 #include <sys/types.h>
diff --git a/test/zdtm/static/pty03.c b/test/zdtm/static/pty03.c
index f60d30d4bf6a..3c2b36369334 100644
--- a/test/zdtm/static/pty03.c
+++ b/test/zdtm/static/pty03.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
 #include <stdlib.h>
 #include "zdtmtst.h"
 #include <sys/types.h>
diff --git a/test/zdtm/static/pty04.c b/test/zdtm/static/pty04.c
index 199d2c758ee6..74d8ab46684b 100644
--- a/test/zdtm/static/pty04.c
+++ b/test/zdtm/static/pty04.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
 #include <stdlib.h>
 #include "zdtmtst.h"
 #include <sys/types.h>
diff --git a/test/zdtm/static/tty00.c b/test/zdtm/static/tty00.c
index aab0d0f08135..473650cddae0 100644
--- a/test/zdtm/static/tty00.c
+++ b/test/zdtm/static/tty00.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
 #include <stdlib.h>
 #include "zdtmtst.h"
 #include <sys/types.h>
diff --git a/test/zdtm/static/tty02.c b/test/zdtm/static/tty02.c
index b179e2fe3c5c..bac0d82beefd 100644
--- a/test/zdtm/static/tty02.c
+++ b/test/zdtm/static/tty02.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
 #include <stdlib.h>
 #include "zdtmtst.h"
 #include <sys/types.h>
diff --git a/test/zdtm/static/tty03.c b/test/zdtm/static/tty03.c
index 741b8719e99b..a582f1031a46 100644
--- a/test/zdtm/static/tty03.c
+++ b/test/zdtm/static/tty03.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
 #include <stdlib.h>
 #include "zdtmtst.h"
 #include <sys/types.h>
-- 
2.9.0



More information about the CRIU mailing list