All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <pmoore@redhat.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH v3 1/6] selinux-testsuite: add _GNU_SOURCE to tests/Makefile
Date: Thu, 04 Jun 2015 16:58:00 -0400	[thread overview]
Message-ID: <20150604205800.19614.98453.stgit@localhost> (raw)
In-Reply-To: <20150604205708.19614.64746.stgit@localhost>

As suggested by Stephen Smalley.  A couple of msgbuf struct
definitions had to be renamed as they were conflicting with system
definitions.

Signed-off-by: Paul Moore <paul@paul-moore.com>
---
 tests/Makefile     |    3 +++
 tests/msg/msgrcv.c |    9 ++++-----
 tests/msg/msgsnd.c |   11 +++++------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index e9d4646..8100b8f 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,3 +1,6 @@
+
+export CFLAGS+=-D_GNU_SOURCE
+
 DISTRO=$(shell ./os_detect)
 
 SUBDIRS_COMMON:=domain_trans entrypoint execshare exectrace execute_no_trans fdreceive inherit link mkdir msg open ptrace readlink relabel rename rxdir sem setattr setnice shm sigkill stat sysctl task_create task_setnice task_setscheduler task_getscheduler task_getsid task_getpgid task_setpgid wait file ioctl capable_file capable_net capable_sys
diff --git a/tests/msg/msgrcv.c b/tests/msg/msgrcv.c
index b23c801..1276c12 100644
--- a/tests/msg/msgrcv.c
+++ b/tests/msg/msgrcv.c
@@ -5,10 +5,9 @@
 #include <sys/msg.h>
 
 #define MSGMAX 1024
-
-struct msgbuf {
-  long mtype;     /* message type, must be > 0 */
-  char mtext[1024];  /* message data */
+struct msgbuf_test {
+	long mtype;
+	char mtext[MSGMAX];
 };
 
 int main(int argc, char **argv)
@@ -17,7 +16,7 @@ int main(int argc, char **argv)
 	int key = 0x8888;
 	int id;
 	int error;
-	struct msgbuf msgp;
+	struct msgbuf_test msgp;
 
 	while ((ch = getopt(argc, argv, "k:")) != EOF) {
 		switch (ch) {
diff --git a/tests/msg/msgsnd.c b/tests/msg/msgsnd.c
index e200aef..57bb027 100644
--- a/tests/msg/msgsnd.c
+++ b/tests/msg/msgsnd.c
@@ -6,10 +6,9 @@
 #include <string.h>
 
 #define MSGMAX 1024
-
-struct msgbuf {
-  long mtype;     /* message type, must be > 0 */
-  char mtext[1024];  /* message data */
+struct msgbuf_test {
+	long mtype;
+	char mtext[MSGMAX];
 };
 
 int main(int argc, char **argv)
@@ -18,7 +17,7 @@ int main(int argc, char **argv)
 	int key = 0x8888;
 	int id;
 	int error;
-	struct msgbuf msgp;
+	struct msgbuf_test msgp;
 
 	while ((ch = getopt(argc, argv, "k:")) != EOF) {
 		switch (ch) {
@@ -32,7 +31,7 @@ int main(int argc, char **argv)
 	if (id == -1)
 		return 1;
 
-	memset(&msgp, 'z', sizeof(struct msgbuf));
+	memset(&msgp, 'z', sizeof(msgp));
 	msgp.mtype = 1;
 
 	error = msgsnd(id, &msgp, MSGMAX, IPC_NOWAIT);

  reply	other threads:[~2015-06-04 20:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 20:57 [PATCH v3 0/6] SELinux testsuite compilation fixes Paul Moore
2015-06-04 20:58 ` Paul Moore [this message]
2015-06-04 20:58 ` [PATCH v3 2/6] selinux-testsuite: add some default CFLAGS Paul Moore
2015-06-04 20:58 ` [PATCH v3 3/6] selinux-testsuite: fix some compile warnings in tests/nnp Paul Moore
2015-06-04 20:58 ` [PATCH v3 4/6] selinux-testsuite: fix compile warnings in tests/setnice Paul Moore
2015-06-04 20:58 ` [PATCH v3 5/6] selinux-testsuite: fix compile problems in tests/shm Paul Moore
2015-06-04 20:58 ` [PATCH v3 6/6] selinux-testsuite: fix compile problems in tests/capable_file Paul Moore
2015-06-05 13:20   ` Stephen Smalley
2015-06-05 13:50     ` Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150604205800.19614.98453.stgit@localhost \
    --to=pmoore@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.