summaryrefslogtreecommitdiffstats
path: root/contrib/libio
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-01-22 02:59:08 +0000
committerobrien <obrien@FreeBSD.org>2000-01-22 02:59:08 +0000
commit19e1413b5dc797995ed95bbd6ca6e3035103d982 (patch)
tree42c6ebe0872fe26c06d5ea952dadd4bcfa2e1fc2 /contrib/libio
parent06f3b914490df649b3b51002ca3211b12d1d0426 (diff)
downloadFreeBSD-src-19e1413b5dc797995ed95bbd6ca6e3035103d982.zip
FreeBSD-src-19e1413b5dc797995ed95bbd6ca6e3035103d982.tar.gz
Bring in bug fixes from the GCC anoncvs server's "gcc-2_95-branch"
branch on Jan 20th, 2000.
Diffstat (limited to 'contrib/libio')
-rw-r--r--contrib/libio/ChangeLog11
-rw-r--r--contrib/libio/filebuf.cc16
-rw-r--r--contrib/libio/stream.h4
-rw-r--r--contrib/libio/strstream.h6
4 files changed, 28 insertions, 9 deletions
diff --git a/contrib/libio/ChangeLog b/contrib/libio/ChangeLog
index 832051a..8151dc2 100644
--- a/contrib/libio/ChangeLog
+++ b/contrib/libio/ChangeLog
@@ -1,3 +1,14 @@
+1999-12-21 Martin v. Löwis <loewis@informatik.hu-berlin.de>
+
+ * filebuf.cc (open): Support ios::ate if _G_HAVE_IO_FILE_OPEN.
+ Remove seek for ios::app if not.
+
+1999-12-14 Martin v. Löwis <loewis@informatik.hu-berlin.de>
+
+ * strstream.h (strstreambuf::streambuf): Rename parameters to
+ avoid shadow warning.
+ * stream.h (WS): Likewise.
+
Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com)
* gcc-2.95.2 Released.
diff --git a/contrib/libio/filebuf.cc b/contrib/libio/filebuf.cc
index 422d442..0b0fd6d 100644
--- a/contrib/libio/filebuf.cc
+++ b/contrib/libio/filebuf.cc
@@ -1,5 +1,5 @@
/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993, 1995 Free Software Foundation
+Copyright (C) 1993, 1995, 1999 Free Software Foundation
This file is part of the GNU IO Library. This library is free
software; you can redistribute it and/or modify it under the
@@ -112,15 +112,23 @@ filebuf* filebuf::open(const char *filename, ios::openmode mode, int prot)
if (mode & (int)ios::noreplace)
posix_mode |= O_EXCL;
#if _G_HAVE_IO_FILE_OPEN
- return (filebuf*)_IO_file_open (this, filename, posix_mode, prot,
- read_write, 0);
+ if (!_IO_file_open (this, filename, posix_mode, prot,
+ read_write, 0))
+ return NULL;
+ if (mode & ios::ate) {
+ if (pubseekoff(0, ios::end) == EOF) {
+ _IO_un_link (this);
+ return NULL;
+ }
+ }
+ return this;
#else
int fd = ::open(filename, posix_mode, prot);
if (fd < 0)
return NULL;
_fileno = fd;
xsetflags(read_write, _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
- if (mode & (ios::ate|ios::app)) {
+ if (mode & ios::ate) {
if (pubseekoff(0, ios::end) == EOF)
return NULL;
}
diff --git a/contrib/libio/stream.h b/contrib/libio/stream.h
index 0859802..90f8c1f 100644
--- a/contrib/libio/stream.h
+++ b/contrib/libio/stream.h
@@ -1,5 +1,5 @@
/*
-Copyright (C) 1993 Free Software Foundation
+Copyright (C) 1993, 1999 Free Software Foundation
This file is part of the GNU IO Library. This library is free
software; you can redistribute it and/or modify it under the
@@ -53,7 +53,7 @@ extern char* oct(unsigned int, int=0);
char* chr(char ch, int width = 0);
char* str(const char* s, int width = 0);
-inline istream& WS(istream& str) { return ws(str); }
+inline istream& WS(istream& __str) { return ws(__str); }
} // extern "C++"
#endif /* !_COMPAT_STREAM_H */
diff --git a/contrib/libio/strstream.h b/contrib/libio/strstream.h
index d549b45..967e5b0 100644
--- a/contrib/libio/strstream.h
+++ b/contrib/libio/strstream.h
@@ -1,5 +1,5 @@
/* This is part of libio/iostream, providing -*- C++ -*- input/output.
-Copyright (C) 1993 Free Software Foundation
+Copyright (C) 1993, 1999 Free Software Foundation
This file is part of the GNU IO Library. This library is free
software; you can redistribute it and/or modify it under the
@@ -50,8 +50,8 @@ class strstreambuf : public streambuf
virtual ~strstreambuf();
strstreambuf() { init_dynamic(0, 0); }
strstreambuf(int initial_size) { init_dynamic(0, 0, initial_size); }
- strstreambuf(void *(*alloc)(_IO_size_t), void (*free)(void*))
- { init_dynamic(alloc, free); }
+ strstreambuf(void *(*__alloc)(_IO_size_t), void (*__free)(void*))
+ { init_dynamic(__alloc, __free); }
strstreambuf(char *ptr, int size, char *pstart = NULL)
{ init_static(ptr, size, pstart); }
strstreambuf(unsigned char *ptr, int size, unsigned char *pstart = NULL)
OpenPOWER on IntegriCloud