mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
helpers.cpp: simplify check_dir(); ported from martii
Origin commit data
------------------
Commit: 44cddc05d9
Author: vanhofen <vanhofen@gmx.de>
Date: 2013-11-22 (Fri, 22 Nov 2013)
Origin message was:
------------------
- helpers.cpp: simplify check_dir(); ported from martii
This commit is contained in:
@@ -212,30 +212,15 @@ int check_dir(const char * dir, bool allow_tmp)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
struct statfs s;
|
struct statfs s;
|
||||||
if (::statfs(dir, &s) == 0) {
|
if (::statfs(dir, &s) == 0) {
|
||||||
switch (s.f_type) /* f_type is long */
|
switch (s.f_type) {
|
||||||
{
|
case 0x858458f6L: // ramfs
|
||||||
case 0xEF53L: /*EXT2 & EXT3*/
|
case 0x1021994L: // tmpfs
|
||||||
case 0x6969L: /*NFS*/
|
|
||||||
case 0xFF534D42L: /*CIFS*/
|
|
||||||
case 0x517BL: /*SMB*/
|
|
||||||
case 0x52654973L: /*REISERFS*/
|
|
||||||
case 0x65735546L: /*fuse for ntfs*/
|
|
||||||
case 0x58465342L: /*xfs*/
|
|
||||||
case 0x4d44L: /*msdos*/
|
|
||||||
case 0x0187: /* AUTOFS_SUPER_MAGIC */
|
|
||||||
#if 0
|
|
||||||
case 0x72b6L: /*jffs2*/
|
|
||||||
#endif
|
|
||||||
ret = 0;//ok
|
|
||||||
break;
|
|
||||||
case 0x858458f6L: /*ramfs*/
|
|
||||||
case 0x1021994: /*TMPFS_MAGIC*/
|
|
||||||
if(allow_tmp)
|
if(allow_tmp)
|
||||||
ret = 0;//ok
|
ret = 0;//ok
|
||||||
|
case 0x72b6L: // jffs2
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "%s Unknown filesystem type: 0x%x\n", dir, (int)s.f_type);
|
ret = 0; // ok
|
||||||
break; // error
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user