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

2015-08-13 Thread Bastian Bittorf
* Alexander Couzens [06.08.2015 19:05]: > lock -n is similiar to flock -n. If the lock was already taken, > fail with exit code = 1 and write error message to stderr. sorry, forget to ask: is this "more" atomic than 'mkdir mypath || return'? bye, bastian _

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

2015-08-06 Thread Felix Fietkau
On 2015-08-06 17:28, 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 locked now. >

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

2015-08-06 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. Signe