mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
5472621ac0
Also rewrite macOS detection to share code with bsd
18 lines
504 B
Objective-C
18 lines
504 B
Objective-C
#include "disk.h"
|
|
|
|
#include <sys/mount.h>
|
|
#import <Foundation/Foundation.h>
|
|
|
|
void detectFsInfo(struct statfs* fs, FFDisk* disk)
|
|
{
|
|
// FreeBSD doesn't support these flags
|
|
if(fs->f_flags & MNT_DONTBROWSE)
|
|
disk->type = FF_DISK_TYPE_HIDDEN;
|
|
else if(fs->f_flags & MNT_REMOVABLE)
|
|
disk->type = FF_DISK_TYPE_EXTERNAL;
|
|
else
|
|
disk->type = FF_DISK_TYPE_REGULAR;
|
|
|
|
ffStrbufInitS(&disk->name, [NSFileManager.defaultManager displayNameAtPath:@(fs->f_mntonname)].UTF8String);
|
|
}
|