Message ID | 20180319133405.2582-1-christian.storm@siemens.com |
---|---|
State | Accepted |
Headers | show |
Series | cpio: hint error reason on copy_write() write failure | expand |
On 19/03/2018 14:34, Christian Storm wrote: > Instead of only stating the failure, give a more explicative > error reason on failure using errno set by write(2). > > Signed-off-by: Christian Storm <christian.storm@siemens.com> > --- > core/cpio_utils.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/core/cpio_utils.c b/core/cpio_utils.c > index 79d1c79..4b6b511 100644 > --- a/core/cpio_utils.c > +++ b/core/cpio_utils.c > @@ -91,12 +91,12 @@ int copy_write(void *out, const void *buf, unsigned int len) > if (ret < 0) { > if (errno == EINTR) > continue; > - ERROR("cannot write %d bytes", len); > + ERROR("cannot write %d bytes: %s", len, strerror(errno)); > return -1; > } > > if (ret == 0) { > - ERROR("cannot write %d bytes", len); > + ERROR("cannot write %d bytes: %s", len, strerror(errno)); > return -1; > } > > Reviewed-by: Stefano Babic <sbabic@denx.de> Best regards, Stefano Babic
diff --git a/core/cpio_utils.c b/core/cpio_utils.c index 79d1c79..4b6b511 100644 --- a/core/cpio_utils.c +++ b/core/cpio_utils.c @@ -91,12 +91,12 @@ int copy_write(void *out, const void *buf, unsigned int len) if (ret < 0) { if (errno == EINTR) continue; - ERROR("cannot write %d bytes", len); + ERROR("cannot write %d bytes: %s", len, strerror(errno)); return -1; } if (ret == 0) { - ERROR("cannot write %d bytes", len); + ERROR("cannot write %d bytes: %s", len, strerror(errno)); return -1; }
Instead of only stating the failure, give a more explicative error reason on failure using errno set by write(2). Signed-off-by: Christian Storm <christian.storm@siemens.com> --- core/cpio_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)