mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-04 23:59:07 +08:00
linux/err.h: add PTR_ERR_OR_ZERO
Add missing PTR_ERR_OR_ZERO implementation. Also add a bunch of generated files to .gitignore. Signed-off-by: Andrii Nakryiko <andriin@fb.com>
This commit is contained in:
committed by
Andrii Nakryiko
parent
59a641543e
commit
e60460f4e5
@@ -30,4 +30,9 @@ static inline bool IS_ERR_OR_NULL(const void *ptr)
|
|||||||
return (!ptr) || IS_ERR_VALUE((unsigned long)ptr);
|
return (!ptr) || IS_ERR_VALUE((unsigned long)ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline long PTR_ERR_OR_ZERO(const void *ptr)
|
||||||
|
{
|
||||||
|
return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
2
src/.gitignore
vendored
2
src/.gitignore
vendored
@@ -1,2 +1,4 @@
|
|||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
|
/libbpf.pc
|
||||||
|
/libbpf.so*
|
||||||
|
|||||||
Reference in New Issue
Block a user