forked from external/yambar
module/removables: no need to open+fdopen, just do fopen()
This commit is contained in:
parent
a367895dc6
commit
3e0083c9f2
1 changed files with 2 additions and 5 deletions
|
@ -161,13 +161,10 @@ content(struct module *mod)
|
||||||
static void
|
static void
|
||||||
find_mount_points(const char *dev_path, mount_point_list_t *mount_points)
|
find_mount_points(const char *dev_path, mount_point_list_t *mount_points)
|
||||||
{
|
{
|
||||||
int fd = open("/proc/self/mountinfo", O_RDONLY | O_CLOEXEC);
|
FILE *f = fopen("/proc/self/mountinfo", "re");
|
||||||
FILE *f = fd >= 0 ? fdopen(fd, "re") : NULL;
|
|
||||||
|
|
||||||
if (fd < 0 || f == NULL) {
|
if (f == NULL) {
|
||||||
LOG_ERRNO("failed to open /proc/self/mountinfo");
|
LOG_ERRNO("failed to open /proc/self/mountinfo");
|
||||||
if (fd >= 0)
|
|
||||||
close(fd);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue