@@ -22,6 +22,7 @@
#define IWPM_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf"
#define SRP_DEAMON_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf"
+#define SRP_DEAMON_LOCK_PREFIX "@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon"
#define ACM_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma"
#define IBACM_LIB_PATH "@ACM_PROVIDER_DIR@"
@@ -131,7 +131,7 @@ static int check_process_uniqueness(struct config_t *conf)
char path[256];
int fd;
- snprintf(path, sizeof(path), "/var/tmp/srp_daemon_%s_%d",
+ snprintf(path, sizeof(path), SRP_DEAMON_LOCK_PREFIX "_%s_%d",
conf->dev_name, conf->port_num);
if ((fd = open(path, O_CREAT|O_RDWR,
'/var/tmp' is an inappropriate places for lock files of this nature, they belong in /var/run. /var/lock does not seem suitable because this lock is not against a basic device node. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- buildlib/config.h.in | 1 + srp_daemon/srp_daemon/srp_daemon.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)