Date: Fri, 04 Jul 2014 01:46:32 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 191593] [fcntl] F_SETFL returns EDEADLK when it shouldn't - only F_SETFLW and waiting should return EDEADLK Message-ID: <bug-191593-8-aTSsqpQJuz@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-191593-8@https.bugs.freebsd.org/bugzilla/> References: <bug-191593-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191593 --- Comment #1 from Adrian Chadd <adrian@freebsd.org> --- Here's what I'm trying with: adrian@test3:~/work/freebsd % svn diff stable/10/src/sys/kern/ Index: stable/10/src/sys/kern/kern_lockf.c =================================================================== --- stable/10/src/sys/kern/kern_lockf.c (revision 267627) +++ stable/10/src/sys/kern/kern_lockf.c (working copy) @@ -1425,6 +1425,14 @@ if (lockf_debug & 1) lf_print("lf_setlock: deadlock", lock); #endif + + /* + * If the lock isn't waiting, return EAGAIN + * rather than EDEADLK. + */ + if (((lock->lf_flags & F_WAIT) == 0) && + (error == EDEADLK)) + error = EAGAIN; lf_free_lock(lock); goto out; } .. this seems to fix the problem. -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-191593-8-aTSsqpQJuz>