From af7b696d3b516aa68995503f642495f3a7082e6d Mon Sep 17 00:00:00 2001 From: Maksym Telychko Date: Thu, 16 Apr 2020 22:48:28 +0300 Subject: MTX-3262 mpower: fix resources leak --- src/utils.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h index eb9d5bc..62d76f1 100644 --- a/src/utils.h +++ b/src/utils.h @@ -30,18 +30,13 @@ enum { USER_YESNO_YES = 1, }; -struct Lock { - char *path; - int fd; -}; - int user_yesno(int def, const char *fmt, ...); int systemf(const char *fmt, ...); FILE *popenf(const char *mode, const char *fmt, ...); char *shell_path_expand(const char *path); -struct Lock *device_lock(const char *path); -struct Lock *device_unlock(struct Lock *lock); +int device_lock(const char *path); +int device_unlock(int lock); int indexOfChar(const char *array, int len, char character); -- cgit v1.2.3