mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 06:52:22 +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);
|