File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -765,6 +765,15 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(char*, unlink_and_free);
765765
766766int free_and_strdup (char * * p , const char * s );
767767
768+ /* Takes inspiration from Rusts's Option::take() method: reads and returns a pointer, but at the same time resets it to
769+ * NULL. See: https://doc.rust-lang.org/std/option/enum.Option.html#method.take */
770+ #define TAKE_PTR (ptr ) \
771+ ({ \
772+ typeof(ptr) _ptr_ = (ptr); \
773+ (ptr) = NULL; \
774+ _ptr_; \
775+ })
776+
768777/* A check against a list of errors commonly used to indicate that a syscall/ioctl/other kernel operation we request is
769778 * not supported locally. We maintain a generic list for this here, instead of adjusting the possible error codes to
770779 * exactly what the calls might return for the simple reasons that due to FUSE and many differing in-kernel
You can’t perform that action at this time.
0 commit comments