Hi Nikos,

I was stupid not to think about this...
And it is a nice tip to use a new shell as a running process.

However, I re-read the lockf man and saw : "By default, lockf waits indefinitely to acquire the lock."
Everything is clear now.

Thanks !


Le 13/04/2011 15:23, Nikos Vassiliadis a écrit :
On 4/13/2011 12:08 PM, Bastien Semene wrote:
I wish that if command #2 can't acquire the lock, lockf exits (exit 0
would be nice).
If I set -t 1, lockf is quite what I'm waiting for. But I like to do
this in a clear way : if it can't acquire the lock it exits, no timeout
wait.

Am I misunderstanding something ? What should I change ?


You should use -t0, something like:
lab# lockf -t 0 /tmp/lock /bin/csh
You have mail.
lab# lockf -t 0 /tmp/lock /bin/csh
lockf: /tmp/lock: already locked
lab# echo $?
75
lab#

HTH, Nikos
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to