• Jiri Slaby's avatar
    ipc/mqueue.c: fix mq_open() return value · d40dcdb0
    Jiri Slaby authored
    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: default avatarJiri Slaby <jslaby@suse.cz>
    Cc: Manfred Spraul <manfred@colorfullife.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d40dcdb0
mqueue.c 30.5 KB