Re: [PATCH v3] libfile: copy_file: prevent spurious error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 18, 2019 at 07:15:27PM +0200, Robert Karszniewicz wrote:
> In all this haste, I forgot my question.
> 
> What error codes should be used? For each goto its own code, in sequence,
> starting from -1?

Please propagate the error code returned from the call that failed. i.e.
something like:

	r = read(srcfd, rw_buf, RW_BUF_SIZE);
	if (r < 0) {
		perror("read");
		ret = r;
		goto out;
	}

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux