]> git.proxmox.com Git - swtpm.git/commitdiff
samples: use flock -x rather than flock -e
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 29 Aug 2018 13:00:54 +0000 (13:00 +0000)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 29 Aug 2018 13:01:40 +0000 (13:01 +0000)
flock -e does not work on NetBSD, so replace it with flock -x,
which should work everywhere.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
samples/swtpm-localca

index fbaed9866a0b71c92fc07183606e6a56c9d8a1a3..25754df14bb46ddafdd840733fd5ea3fdc3af5b0 100755 (executable)
@@ -123,7 +123,7 @@ get_next_cert_serial() {
        touch ${LOCK}
        (
                # Avoid concurrent creation of next serial
-               flock -e 100
+               flock -x 100
                if [ $? -ne 0 ]; then
                        logerr "Could not get lock ${LOCK}"
                        return 1
@@ -264,7 +264,7 @@ create_localca_cert() {
        touch ${LOCK}
        (
                # Avoid concurrent creation of keys and certs
-               flock -e 100
+               flock -x 100
                if [ $? -ne 0 ]; then
                        logerr "Could not get lock ${LOCK}"
                        return 1