* syscalls.cc (truncate64): Don't second-guess errno if open fails.

This commit is contained in:
Christopher Faylor 2004-12-01 15:00:40 +00:00
parent ee58ee4a28
commit 576bfeeca8
4 changed files with 1150 additions and 1164 deletions

View File

@ -1,3 +1,7 @@
2004-12-01 Christopher Faylor <cgf@timesys.com>
* syscalls.cc (truncate64): Don't second-guess errno if open fails.
2004-11-25 Christopher Faylor <cgf@timesys.com>
* environ.cc (putenv): Accommodate recent newlib change in argument to

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ const device dev_bad_storage =
"/dev/kmem", FH_KMEM, "\\dev\\mem"
"/dev/clipboard", FH_CLIPBOARD, "\\dev\\clipboard"
"/dev/port", FH_PORT, "\\dev\\port"
"/dev/com%(0-16)d", FHDEV(DEV_SERIAL_MAJOR, {$1}), "\\\\.\\com{$1}"
"/dev/com%(1-16)d", FHDEV(DEV_SERIAL_MAJOR, {$1}), "\\\\.\\com{$1}"
"/dev/ttyS%(0-15)d", FHDEV(DEV_SERIAL_MAJOR, {$1 + 1}), "\\\\.\\com{$1 + 1}"
"/dev/pipe", FH_PIPE, "\\dev\\pipe"
"/dev/fifo", FH_FIFO, "\\dev\\fifo"

View File

@ -1734,9 +1734,7 @@ truncate64 (const char *pathname, _off64_t length)
fd = open (pathname, O_RDWR);
if (fd == -1)
set_errno (EBADF);
else
if (fd != -1)
{
res = ftruncate64 (fd, length);
close (fd);