mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 18:34:57 +02:00
comment
also improved the macro, making it stricter Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+17
-3
@@ -714,11 +714,25 @@ ino_t tmp_ino;
|
|||||||
int tmp_fd = -1;
|
int tmp_fd = -1;
|
||||||
char *tname = NULL;
|
char *tname = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Used for checking whether.
|
||||||
|
* a file is a file via stat().
|
||||||
|
*
|
||||||
|
* Portable macro for compatibility
|
||||||
|
* with older unix e.g. v7 unix (has S_IFREG),
|
||||||
|
* 4.2bsd (has S_IFMT) or POSIX (has S_ISREG)
|
||||||
|
*
|
||||||
|
* Fallback works where S_IFREG == 0100000
|
||||||
|
* (classic unix bitmask)
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef S_ISREG
|
#ifndef S_ISREG
|
||||||
#ifdef S_IFMT
|
#if defined(S_IFMT) && defined(S_IFREG)
|
||||||
#define S_ISREG(m) (((m) & (S_IFMT)) == (S_IFREG))
|
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||||
|
#elif defined(S_IFREG)
|
||||||
|
#define S_ISREG(m) (((m) & S_IFREG) != 0)
|
||||||
#else
|
#else
|
||||||
#define S_ISREG(m) (((m) & (S_IFREG)) == (S_IFREG))
|
#error "can't determine types with stat()"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user