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

2015-08-13 Thread Bastian Bittorf
* Alexander Couzens [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 /tm

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

2015-08-07 Thread Rafał Miłecki
On 7 August 2015 at 17:40, Alexander Couzens wrote: > 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 lock

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

2015-08-07 Thread Jonas Gorski
On Fri, Aug 7, 2015 at 5:40 PM, Alexander Couzens wrote: > 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

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

2015-08-07 Thread Alexander Couzens
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. v1: i