From a2eda5de55c7176a345b3a1e0d5a45b5773455c7 Mon Sep 17 00:00:00 2001 From: Maksym Telychko Date: Thu, 16 Apr 2020 16:48:25 +0300 Subject: Revert "MTX-3262 mpower lockfile rewrite for libmts-io compatibility" This reverts commit f4b78a288c9e5c2a7a05d71b9bbe9e5fc26f2a63. --- src/atcmd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/atcmd.c') diff --git a/src/atcmd.c b/src/atcmd.c index eab4210..97fd34b 100644 --- a/src/atcmd.c +++ b/src/atcmd.c @@ -1471,7 +1471,7 @@ static int sms_atcmd_init(int fd) return 0; } -static struct Lock *lock_file; +static char *lock_path; int sms_device_close(int fd) { @@ -1479,7 +1479,11 @@ int sms_device_close(int fd) ret = tty_close(fd); - lock_file = device_unlock(lock_file); + if (lock_path) { + unlink(lock_path); + free(lock_path); + lock_path = NULL; + } return ret; } @@ -1494,8 +1498,8 @@ int sms_device_open(void) return -1; } - lock_file = device_lock(Global.core.device); - if (!lock_file) { + lock_path = device_lock(Global.core.device); + if (!lock_path) { sms_device_close(fd); return -1; } -- cgit v1.2.3