[OpenWrt-Devel] [PATCH v2] busybox: lock: implement -n "Fail rather than wait"

Bastian Bittorf bittorf at bluebottle.com
Thu Aug 13 06:31:56 EDT 2015


* Alexander Couzens <lynxis at fe80.eu> [07.08.2015 20:48]:
> lock -n is similiar to flock -n. If the lock was already taken,
> fail with exit code = 1 and write error message to stderr.

see: http://mywiki.wooledge.org/BashFAQ/045
internally we are using 'mkdir' which is called via a 'lock()' function:

if mkdir /tmp/lock_$reason; then
	return 0
else
	return 1
fi

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list