[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

flock(1) exit code (enhancement request)

From: Jan Kasprzak
Subject: flock(1) exit code (enhancement request)
Date: Mon, 30 Apr 2012 14:19:15 +0200
User-agent: Mutt/1.5.20 (2009-12-10)

        Hello, coreutils developers!

I use flock(1) from coreutils in my scripts, and with --wait or --nonblock
I would like to be able to distinguish between the "conflicting lock exists"
and "-c <command> exited with code 1" states.

        Of course, I can always wrap the -c argument with something like
bash -c "<original_cmd_and_args> || exit 2" with yet another level of
quoting, but I think it is really ugly.

        This problem can be solved for example by mapping the exit code 1
of the -c command to something else. I.e. to add something like

        -m <number>
        --map-exit-code-1-to <number>

where the exit code of flock(1) would be <number>, iff the -c <command> exits
with code 1.

        What do you think about it? If you agree with the above syntax,
I can of course post a patch to flock(1).



| Jan "Yenya" Kasprzak  <kas at { - work | - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
|    Journal: |
Please don't top post and in particular don't attach entire digests to your
mail or we'll all soon be using bittorrent to read the list.     --Alan Cox

reply via email to

[Prev in Thread] Current Thread [Next in Thread]