2021-10-01 10:28:36 +00:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2018-03-22 16:04:29 +00:00
|
|
|
@@
|
|
|
|
local idexpression p;
|
|
|
|
expression q;
|
|
|
|
@@
|
|
|
|
- p = q;
|
2023-07-08 18:33:26 +00:00
|
|
|
- q = -EBADF;
|
2018-03-22 16:04:29 +00:00
|
|
|
- return p;
|
|
|
|
+ return TAKE_FD(q);
|
2019-04-27 10:26:22 +00:00
|
|
|
|
|
|
|
/* The ideal solution would use 'local idexpression' to avoid matching errno,
|
|
|
|
* which is a global variable. However, 'idexpression' nor 'identifier'
|
|
|
|
* would match, for example, "x->fd", which is considered 'expression' in
|
|
|
|
* the SmPL grammar
|
|
|
|
*/
|
2018-03-22 16:04:29 +00:00
|
|
|
@@
|
2019-04-27 10:26:22 +00:00
|
|
|
expression p != errno;
|
|
|
|
expression q;
|
2018-03-22 16:04:29 +00:00
|
|
|
@@
|
|
|
|
- p = q;
|
2023-07-08 18:33:26 +00:00
|
|
|
- q = -EBADF;
|
2018-03-22 16:04:29 +00:00
|
|
|
+ p = TAKE_FD(q);
|