summaryrefslogtreecommitdiff
path: root/src/atcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/atcmd.c')
-rw-r--r--src/atcmd.c12
1 files changed, 8 insertions, 4 deletions
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;
}