Bug 210770 - lockf(1): EX_UNAVAILABLE is not returned
Summary: lockf(1): EX_UNAVAILABLE is not returned
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Andriy Voskoboinyk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-03 09:58 UTC by eserte12
Modified: 2019-03-27 09:02 UTC (History)
1 user (show)

See Also:
avos: mfc-stable12+
avos: mfc-stable11+
avos: mfc-stable10+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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