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