summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/atcmd.c8
-rw-r--r--src/utils.c2
-rw-r--r--src/utils.h2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/atcmd.c b/src/atcmd.c
index 1aa415c..76ee98c 100644
--- a/src/atcmd.c
+++ b/src/atcmd.c
@@ -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;
}
@@ -1566,4 +1570,4 @@ int is_quectel_model()
}
return 0;
-}
+} \ No newline at end of file
diff --git a/src/utils.c b/src/utils.c
index 138c87d..5d46a36 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -33,7 +33,6 @@
#include <fcntl.h>
#include <string.h>
#include <linux/limits.h>
-#include <sys/file.h>
#include "utils.h"
#include "log.h"
@@ -297,4 +296,3 @@ int indexOfChar(const char *array, int len, char character)
}
return -1;
}
-
diff --git a/src/utils.h b/src/utils.h
index 62d76f1..32b4c89 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -45,4 +45,4 @@ int indexOfChar(const char *array, int len, char character);
#define indentf(n, format, args...) \
printf("%*s" format , n, "" , ## args)
-#endif /* ~__UTILS_H */
+#endif /* ~__UTILS_H */ \ No newline at end of file