From: Jiri Slaby Date: Tue, 26 Jul 2011 23:08:47 +0000 (-0700) Subject: ipc/mqueue.c: fix mq_open() return value X-Git-Tag: v3.1-rc1~184 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d40dcdb0172a1ba853464983a059fb45e0aaf61a;p=pandora-kernel.git ipc/mqueue.c: fix mq_open() return value We return ENOMEM from mqueue_get_inode even when we have enough memory. Namely in case the system rlimit of mqueue was reached. This error propagates to mq_queue and user sees the error unexpectedly. So fix this up to properly return EMFILE as described in the manpage: EMFILE The process already has the maximum number of files and message queues open. instead of: ENOMEM Insufficient memory. With the previous patch we just switch to ERR_PTR/PTR_ERR/IS_ERR error handling here. Signed-off-by: Jiri Slaby Cc: Manfred Spraul Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed