| From e09ad9a33840ed83b91dd3901492ecf99ab89076 Mon Sep 17 00:00:00 2001 |
| From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz> |
| Date: Wed, 21 Oct 2020 23:06:21 +0200 |
| Subject: [PATCH] fw_*env: do not rely on /var/lock |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| ...because these are not available under the new Buildroot. |
| |
| Signed-off-by: Jan Kundrรกt <jan.kundrat@cesnet.cz> |
| --- |
| tools/env/README | 2 +- |
| tools/env/fw_env_main.c | 6 +++--- |
| 2 files changed, 4 insertions(+), 4 deletions(-) |
| |
| diff --git a/tools/env/README b/tools/env/README |
| index 709251383c..480a893202 100644 |
| --- a/tools/env/README |
| +++ b/tools/env/README |
| @@ -59,5 +59,5 @@ this environment instance. On NAND this is used to limit the range |
| within which bad blocks are skipped, on NOR it is not used. |
| |
| To prevent losing changes to the environment and to prevent confusing the MTD |
| -drivers, a lock file at /var/lock/fw_printenv.lock is used to serialize access |
| +drivers, a lock file at /run/fw_printenv.lock is used to serialize access |
| to the environment. |
| diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c |
| index 26ba6624cd..4c84b13cfc 100644 |
| --- a/tools/env/fw_env_main.c |
| +++ b/tools/env/fw_env_main.c |
| @@ -72,7 +72,7 @@ void usage_printenv(void) |
| " -c, --config configuration file, default:" CONFIG_FILE "\n" |
| #endif |
| " -n, --noheader do not repeat variable name in output\n" |
| - " -l, --lock lock node, default:/var/lock\n" |
| + " -l, --lock lock node, default:/run\n" |
| "\n"); |
| } |
| |
| @@ -87,7 +87,7 @@ void usage_env_set(void) |
| #ifdef CONFIG_FILE |
| " -c, --config configuration file, default:" CONFIG_FILE "\n" |
| #endif |
| - " -l, --lock lock node, default:/var/lock\n" |
| + " -l, --lock lock node, default:/run\n" |
| " -s, --script batch mode to minimize writes\n" |
| "\n" |
| "Examples:\n" |
| @@ -205,7 +205,7 @@ int parse_setenv_args(int argc, char *argv[]) |
| |
| int main(int argc, char *argv[]) |
| { |
| - char *lockname = "/var/lock/" CMD_PRINTENV ".lock"; |
| + char *lockname = "/run/" CMD_PRINTENV ".lock"; |
| int lockfd = -1; |
| int retval = EXIT_SUCCESS; |
| char *_cmdname; |
| -- |
| 2.28.0 |
| |