more per-platform support ifdef work for displaying permissions
This commit is contained in:
parent
c1d21ff630
commit
ba981b075a
|
@ -653,6 +653,12 @@ bool cUnixFSServices::GetGroupName(gid_t group_id, TSTRING& tstrGroup) const
|
||||||
#ifndef S_ISVTX // DOS/DJGPP doesn't have this
|
#ifndef S_ISVTX // DOS/DJGPP doesn't have this
|
||||||
# define S_ISVTX 0
|
# define S_ISVTX 0
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef S_ISUID
|
||||||
|
# define S_ISUID 0
|
||||||
|
#endif
|
||||||
|
#ifndef S_ISGID
|
||||||
|
# define S_ISGID 0
|
||||||
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// Function name : cUnixFSServices::ConvertModeToString
|
// Function name : cUnixFSServices::ConvertModeToString
|
||||||
|
@ -678,38 +684,50 @@ void cUnixFSServices::ConvertModeToString(uint64_t perm, TSTRING& tstrPerm) cons
|
||||||
switch ((uint32_t)perm & S_IFMT) //some versions of Unix don't like to switch on
|
switch ((uint32_t)perm & S_IFMT) //some versions of Unix don't like to switch on
|
||||||
//64 bit values.
|
//64 bit values.
|
||||||
{
|
{
|
||||||
|
#ifdef S_IFDIR
|
||||||
case S_IFDIR:
|
case S_IFDIR:
|
||||||
szPerm[0] = _T('d');
|
szPerm[0] = _T('d');
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifdef S_IFCHR
|
||||||
case S_IFCHR:
|
case S_IFCHR:
|
||||||
szPerm[0] = _T('c');
|
szPerm[0] = _T('c');
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifdef S_IFBLK
|
||||||
case S_IFBLK:
|
case S_IFBLK:
|
||||||
szPerm[0] = _T('b');
|
szPerm[0] = _T('b');
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifdef S_IFIFO
|
||||||
case S_IFIFO:
|
case S_IFIFO:
|
||||||
szPerm[0] = _T('p');
|
szPerm[0] = _T('p');
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifdef S_IFLNK
|
||||||
case S_IFLNK:
|
case S_IFLNK:
|
||||||
szPerm[0] = _T('l');
|
szPerm[0] = _T('l');
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
#if HAVE_DOOR_CREATE // Solaris doors
|
#ifdef S_IFDOOR // Solaris doors
|
||||||
case S_IFDOOR:
|
case S_IFDOOR:
|
||||||
szPerm[0] = _T('D');
|
szPerm[0] = _T('D');
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef S_IFPORT // Solaris event ports
|
||||||
#if HAVE_PORT_CREATE // Solaris event ports
|
|
||||||
case S_IFPORT:
|
case S_IFPORT:
|
||||||
szPerm[0] = _T('P');
|
szPerm[0] = _T('P');
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef S_IFNAM
|
#ifdef S_IFNAM
|
||||||
case S_IFNAM:
|
case S_IFNAM:
|
||||||
szPerm[0] = _T('n');
|
szPerm[0] = _T('n');
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifdef S_IFNATIVE
|
||||||
|
case S_IFNATIVE:
|
||||||
|
szPerm[0] = _T('?'); // TODO: check how this looks in qsh
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue