mirror of
https://github.com/systemd/systemd.git
synced 2024-10-31 16:21:26 +03:00
c10d6bdb89
This is similar to TAKE_PTR() but operates on file descriptors, and thus assigns -1 to the fd parameter after returning it. Removes 60 lines from our codebase. Pretty good too I think.
15 lines
154 B
Plaintext
15 lines
154 B
Plaintext
@@
|
|
local idexpression p;
|
|
expression q;
|
|
@@
|
|
- p = q;
|
|
- q = -1;
|
|
- return p;
|
|
+ return TAKE_FD(q);
|
|
@@
|
|
expression p, q;
|
|
@@
|
|
- p = q;
|
|
- q = -1;
|
|
+ p = TAKE_FD(q);
|