close fd in hyper_create

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
This commit is contained in:
Gao feng
2016-05-24 15:59:17 +08:00
parent 5b7069c8b4
commit 211eb96eb6
+6 -1
View File
@@ -106,7 +106,12 @@ static inline int hyper_unlink(char *hyper_path)
static inline int hyper_create(char *hyper_path)
{
return creat(hyper_path, 0755);
int fd = creat(hyper_path, 0755);
if (fd < 0)
return -1;
close(fd);
return 0;
}
int hyper_mkdir(char *hyper_path);