FreeBSD doesn't have /var/lock as Linux does per the FHS.
On FreeBSD, /var/run is the closest match being used for
daemon/service lock files.
Signed-off-by: Christian Storm <
christi...@siemens.com>
---
src/uboot_env.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/uboot_env.c b/src/uboot_env.c
index ea58f6d..c4b2405 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -53,7 +53,11 @@ extern int parse_yaml_config(struct uboot_ctx **ctxlist, FILE *fp);
* the fw_printenv utilities. Custom lockfile can be set via
* configuration file.
*/
+#if defined(__FreeBSD__)
+static const char *default_lockname = "/var/run/fw_printenv.lock";
+#else
static const char *default_lockname = "/var/lock/fw_printenv.lock";
+#endif
static struct uboot_version_info libinfo;
static int libuboot_lock(struct uboot_ctx *ctx)
--
2.55.0