Bug 210770

Summary: lockf(1): EX_UNAVAILABLE is not returned
Product: Base System Reporter: eserte12
Component: binAssignee: Andriy Voskoboinyk <avos>
Status: Closed FIXED    
Severity: Affects Only Me CC: avos
Priority: --- Flags: avos: mfc-stable12+
avos: mfc-stable11+
avos: mfc-stable10+
Version: 10.1-RELEASE   
Hardware: Any   
OS: Any   

Description eserte12 2016-07-03 09:58:02 UTC
The lockf(1) manpage documents that EX_UNAVAILABLE is returned if -n is used and the lock file does not exist. This is not the case:

$ lockf -n /tmp/doesnotexist echo; echo $?
lockf: cannot open /tmp/doesnotexist: No such file or directory
73

EX_CANTCREAT (73) is returned instead.
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-03-20 07:41:14 UTC
A commit references this bug:

Author: avos
Date: Wed Mar 20 07:40:39 UTC 2019
New revision: 345318
URL: https://svnweb.freebsd.org/changeset/base/345318

Log:
  lockf(1): return EX_UNAVAILABLE if -n is used and the lock file does not
  exist

  Apply EX_UNAVAILABLE patch part from PR 170775 to match the documentation.

  Checked with a command from PR 210770:
  lockf -n /tmp/doesnotexist echo; echo $?

  PR:		210770
  MFC after:	1 week

Changes:
  head/usr.bin/lockf/lockf.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-03-27 08:56:16 UTC
A commit references this bug:

Author: avos
Date: Wed Mar 27 08:56:00 UTC 2019
New revision: 345569
URL: https://svnweb.freebsd.org/changeset/base/345569

Log:
  MFC r345318:
  lockf(1): return EX_UNAVAILABLE if -n is used and the lock file does not
  exist

  Apply EX_UNAVAILABLE patch part from PR 170775 to match the documentation.

  Was checked with a command from PR 210770:
  lockf -n /tmp/doesnotexist echo; echo $?

  PR:		210770

Changes:
_U  stable/10/
  stable/10/usr.bin/lockf/lockf.c
_U  stable/11/
  stable/11/usr.bin/lockf/lockf.c
_U  stable/12/
  stable/12/usr.bin/lockf/lockf.c