git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
feat: readdir fix and demo
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
common.h
diff --git
a/lunaix-os/includes/lunaix/common.h
b/lunaix-os/includes/lunaix/common.h
index 7fdf0b30cbe88327a0cd111ff34f643a9f972dbc..d341daa341120feca19b36510b7987d657cbcf46 100644
(file)
--- a/
lunaix-os/includes/lunaix/common.h
+++ b/
lunaix-os/includes/lunaix/common.h
@@
-48,7
+48,7
@@
#define container_of(ptr, type, member) \
({ \
const typeof(((type*)0)->member)* __mptr = (ptr); \
- (
type*)((char*)__mptr - offsetof(type, member));
\
+ (
ptr) ? (type*)((char*)__mptr - offsetof(type, member)) : 0;
\
})
#endif