Skip to content
Snippets Groups Projects
Commit 4d1e4ce9 authored by Costas Argyris's avatar Costas Argyris Committed by Jeff Law
Browse files

libiberty: writeargv: Simplify function error mode.

writeargv can be simplified by getting rid of the error exit mode
that was only relevant many years ago when the function used
to open the file descriptor internally.

0001-libiberty-writeargv-Simplify-function-error-mode.patch

From 1271552baee5561fa61652f4ca7673c9667e4f8f Mon Sep 17 00:00:00 2001
From: Costas Argyris <costas.argyris@gmail.com>
Date: Mon, 5 Jun 2023 15:02:06 +0100
Subject: [PATCH] libiberty: writeargv: Simplify function error mode.

The goto-based error mode was based on a previous version
of the function where it was responsible for opening the
file, so it had to close it upon any exit:

https://inbox.sourceware.org/gcc-patches/20070417200340.GM9017@sparrowhawk.codesourcery.com/



(thanks pinskia)

This is no longer the case though since now the function
takes the file descriptor as input, so the exit mode on
error can be just a simple return 1 statement.

libiberty/
	* argv.c (writeargv): Simplify & remove gotos.

Signed-off-by: default avatarCostas Argyris <costas.argyris@gmail.com>
parent 9677cc74
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment