diff options
author | Arthur She <arthur.she@linaro.org> | 2014-09-18 14:16:56 -0700 |
---|---|---|
committer | Arthur She <arthur.she@linaro.org> | 2014-09-18 14:16:56 -0700 |
commit | 39e0e0dcb02d948940c79466c302b3db4c60f3d0 (patch) | |
tree | 117c21aa0b42865a321b078ddb71c410506c51c9 /ipc | |
parent | c92da2541205425c520bc856dc6c87211c12595a (diff) |
Update to d9773ceabfaf3f27b8a36fac035b74ee599df900 from repo git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git branch masterd9773ceabfaf3f27b8a36fac035b74ee599df900linux-mainline
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/Makefile | 6 | ||||
-rw-r--r-- | ipc/msgque.c | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/ipc/Makefile b/ipc/Makefile index 5386fd7..74bbefd 100644 --- a/ipc/Makefile +++ b/ipc/Makefile @@ -1,18 +1,18 @@ uname_M := $(shell uname -m 2>/dev/null || echo not) ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) ifeq ($(ARCH),i386) - ARCH := X86 + ARCH := x86 CFLAGS := -DCONFIG_X86_32 -D__i386__ endif ifeq ($(ARCH),x86_64) - ARCH := X86 + ARCH := x86 CFLAGS := -DCONFIG_X86_64 -D__x86_64__ endif CFLAGS += -I../../../../usr/include/ all: -ifeq ($(ARCH),X86) +ifeq ($(ARCH),x86) gcc $(CFLAGS) msgque.c -o msgque_test else echo "Not an x86 target, can't build msgque selftest" diff --git a/ipc/msgque.c b/ipc/msgque.c index d664182..552f081 100644 --- a/ipc/msgque.c +++ b/ipc/msgque.c @@ -193,6 +193,11 @@ int main(int argc, char **argv) int msg, pid, err; struct msgque_data msgque; + if (getuid() != 0) { + printf("Please run the test as root - Exiting.\n"); + exit(1); + } + msgque.key = ftok(argv[0], 822155650); if (msgque.key == -1) { printf("Can't make key\n"); @@ -201,6 +206,7 @@ int main(int argc, char **argv) msgque.msq_id = msgget(msgque.key, IPC_CREAT | IPC_EXCL | 0666); if (msgque.msq_id == -1) { + err = -errno; printf("Can't create queue\n"); goto err_out; } |