1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2@@
3local idexpression p;
4expression q;
5@@
6- p = q;
7- q = -1;
8- return p;
9+ return TAKE_FD(q);
10
11/* The ideal solution would use 'local idexpression' to avoid matching errno,
12 * which is a global variable. However, 'idexpression' nor 'identifier'
13 * would match, for example, "x->fd", which is considered 'expression' in
14 * the SmPL grammar
15 */
16@@
17expression p != errno;
18expression q;
19@@
20- p = q;
21- q = -1;
22+ p = TAKE_FD(q);
23