mirror of
https://github.com/deepseek-ai/3FS
synced 2025-06-26 18:16:45 +00:00
fix(fuse): fix fd leak in extract_mount_point
Some checks failed
Build / build (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
This commit is contained in:
parent
91bfcf3606
commit
2db69ced80
@ -2,6 +2,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <folly/logging/xlog.h>
|
#include <folly/logging/xlog.h>
|
||||||
|
#include <folly/ScopeGuard.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <numa.h>
|
#include <numa.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -49,6 +50,7 @@ int hf3fs_extract_mount_point(char *hf3fs_mount_point, int size, const char *pat
|
|||||||
|
|
||||||
auto fp = fopen("/proc/self/mountinfo", "r");
|
auto fp = fopen("/proc/self/mountinfo", "r");
|
||||||
XLOGF_IF(FATAL, !fp, "cannot read system mount info");
|
XLOGF_IF(FATAL, !fp, "cannot read system mount info");
|
||||||
|
SCOPE_EXIT { fclose(fp); };
|
||||||
|
|
||||||
char line[4096];
|
char line[4096];
|
||||||
std::vector<std::string> parts;
|
std::vector<std::string> parts;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user