Message ID | 20171006073721.11642-1-christian.storm@siemens.com |
---|---|
State | Accepted |
Headers | show |
Series | cpio: hint error reason on buffer fill failure | expand |
Hi Christian, On 06/10/2017 09:37, Christian Storm wrote: > Instead of only stating the failure, give a > more explicative error reason on failure. > > Signed-off-by: Christian Storm <christian.storm@siemens.com> > --- > core/cpio_utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/core/cpio_utils.c b/core/cpio_utils.c > index e8651a3..e962fae 100644 > --- a/core/cpio_utils.c > +++ b/core/cpio_utils.c > @@ -61,7 +61,7 @@ int fill_buffer(int fd, unsigned char *buf, unsigned int nbytes, unsigned long * > while (nbytes > 0) { > len = read(fd, buf, nbytes); > if (len < 0) { > - ERROR("Failure in stream: I cannot go on\n"); > + ERROR("Failure in stream %d: %s", fd, strerror(errno)); > return -EFAULT; > } > if (len == 0) { > Acked-by: Stefano Babic <sbabic@denx.de> Best regards, Stefano Babic
On 06/10/2017 09:37, Christian Storm wrote: > Instead of only stating the failure, give a > more explicative error reason on failure. > > Signed-off-by: Christian Storm <christian.storm@siemens.com> > --- > core/cpio_utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/core/cpio_utils.c b/core/cpio_utils.c > index e8651a3..e962fae 100644 > --- a/core/cpio_utils.c > +++ b/core/cpio_utils.c > @@ -61,7 +61,7 @@ int fill_buffer(int fd, unsigned char *buf, unsigned int nbytes, unsigned long * > while (nbytes > 0) { > len = read(fd, buf, nbytes); > if (len < 0) { > - ERROR("Failure in stream: I cannot go on\n"); > + ERROR("Failure in stream %d: %s", fd, strerror(errno)); > return -EFAULT; > } > if (len == 0) { > Applied to -master, thanks ! Best regards, Stefano Babic
diff --git a/core/cpio_utils.c b/core/cpio_utils.c index e8651a3..e962fae 100644 --- a/core/cpio_utils.c +++ b/core/cpio_utils.c @@ -61,7 +61,7 @@ int fill_buffer(int fd, unsigned char *buf, unsigned int nbytes, unsigned long * while (nbytes > 0) { len = read(fd, buf, nbytes); if (len < 0) { - ERROR("Failure in stream: I cannot go on\n"); + ERROR("Failure in stream %d: %s", fd, strerror(errno)); return -EFAULT; } if (len == 0) {
Instead of only stating the failure, give a more explicative error reason on failure. Signed-off-by: Christian Storm <christian.storm@siemens.com> --- core/cpio_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)