2010-08-24 Ralf Corsépius <ralf.corsepius@rtems.org>

* libmisc/untar/untar.c: Return if open fails.
	Use ssize_t for read() return value.
This commit is contained in:
Ralf Corsepius
2010-08-24 13:06:24 +00:00
parent 89dbb28bd4
commit b15fb6e065
2 changed files with 13 additions and 9 deletions
+4 -2
View File
@@ -1,11 +1,13 @@
2010-09-24 Ralf Corsépius <ralf.corsepius@rtems.org>
2010-08-24 Ralf Corsépius <ralf.corsepius@rtems.org>
* libmisc/untar/untar.c: Return if open fails.
Use ssize_t for read() return value.
* posix/src/aio_cancel.c: Spray pthread_mutex_unlocks.
* posix/src/aio_read.c: aio_nbytes is always >= 0.
* posix/src/aio_write.c: aio_nbytes is always >= 0.
Fix typo in comment.
2010-09-24 Ralf Corsépius <ralf.corsepius@rtems.org>
2010-08-24 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/include/sys/utsname.h: Remove times().
Remove unnecessary includes.
+9 -7
View File
@@ -254,7 +254,7 @@ Untar_FromFile(
{
int fd;
char *bufr;
size_t n;
ssize_t n;
char fname[100];
char linkname[100];
int sum;
@@ -265,15 +265,17 @@ Untar_FromFile(
unsigned long size;
unsigned char linkflag;
retval = UNTAR_SUCCESSFUL;
bufr = (char *)malloc(512);
if (bufr == NULL)
{
return(UNTAR_FAIL);
if ((fd = open(tar_name, O_RDONLY)) < 0) {
return UNTAR_FAIL;
}
fd = open(tar_name, O_RDONLY);
bufr = (char *)malloc(512);
if (bufr == NULL) {
return(UNTAR_FAIL);
}
while (1)
{
/* Read the header */