Skip to content
Snippets Groups Projects
Commit 3670f412 authored by Felix Fietkau's avatar Felix Fietkau
Browse files

busybox: lock: implement -n "Fail rather than wait"


lock -n is similiar to flock -n. If the lock was already taken,
fail with exit code = 1 and write error message to stderr.

example:
if ! lock -n /tmp/foo ; then
	echo lock exits.
else
	echo lock was free. But is locked now.
fi
> lock was free. But is locked now.
> lock exists.

Signed-off-by: default avatarAlexander Couzens <lynxis@fe80.eu>

SVN-Revision: 46836
parent 5fcafa31
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment