Re: [PATCH 03/14] copy_fd: pass error message back through a strbuf

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

 



Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

> -extern int copy_fd(int ifd, int ofd);
> +extern int copy_fd(int ifd, int ofd, struct strbuf *err);

It is not limited to this single function, but what contract do we
envision this "error messages are given back to the caller via
strbuf" convention should give between the callers and the callee?

For example, is it a bug in the callee to touch "err" when there is
no error to report?  Another example is if we should allow the
callers to pass NULL there when they do not care about the nature of
the error (e.g. "git cmd -q").

There may be other rules we want to enforce consistently across
functions that adopt this convention.

The change in this patch looks sensible.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]