[LTP] [PATCH 6/6] fs: rewrite stream05 test using new API
Cyril Hrubis
chrubis@suse.cz
Mon Mar 2 14:52:08 CET 2026
Hi!
> +// SPDX-License-Identifier: GPL-2.0-or-later
> /*
> - *
> - * Copyright (c) International Business Machines Corp., 2002
Shouldn't this copyright stay?
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
> - * the GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com>
> */
>
...
> + stream = SAFE_FOPEN(FILENAME, "a+");
> + SAFE_FWRITE(data, 1, DATASIZE, stream);
Shouldn't this be SAFE_FFLUSH(stream) here?
The previous test closed and opened the stream before, which explicitly
flushed the buffers.
> - local_flag = PASSED;
> - /*--------------------------------------------------------------------*/
> - //block2:
> + fd = TST_EXP_FD(SAFE_FILENO(stream));
This is wrong, either we use SAFE_MACRO or TST_EXP macro. Using both of
them like this does not make any sense since the SAFE_FILENO() does not
return on a failure.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list