Age | Commit message (Collapse) | Author |
|
OK schwarze@
|
|
Recommend POSIX getline(3) instead.
|
|
to determine the length instead of doing it manually. OK schwarze@
|
|
even though ferror(3) is already set;
also from Andrey Chernov <ache at freebsd dot org>;
OK millert@
|
|
and failed (setting errno and ferror(3)) both at the same time.
That's a bad idea in general, and here in particular since
returning partial lines was neither reliable (sometimes, you
got NULL anyway) nor predictable (almost always, the line would
be truncated long before the actual read error).
Instead, on read failure, fail properly and always return NULL.
Issue found in a discussion with Andrey Chernov <ache at freebsd dot org>
who finally agreed to move FreeBSD into the same direction.
The fix is joint work with and OK by millert@.
|
|
from Andrey Chernov <ache at freebsd dot org>;
OK millert@
|
|
OK jca@ martijn@ millert@
|
|
|
|
Over time we can repair software which performs this non-standard behaviour,
and fix bugs along the way. Let's first find out how bad the situation is
by deploying this in snapshots.
This type of logging is possible because OpenBSD syslog_r(3) -> sendsyslog(2)
is side-effect free enough to be used in the bowels of libc.
ok tedu
|
|
|
|
|
|
completion, just like puts(3). Found the hard way in portable code.
OK jmc@
|
|
ok deraadt@
|
|
This stores errno, the cancelation flags, and related bits for each thread
and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable!
Make libpthread dlopen'able by moving the cancelation wrappers into libc
and doing locking and fork/errno handling via callbacks that libpthread
registers when it first initializes. 'errno' *must* be declared via
<errno.h> now!
Clean up libpthread's symbol exports like libc.
On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec.
Testing by various, particularly sthen@ and patrick@
ok kettenis@
|
|
data isn't necessary.
ok mpi@, ok&tweak natano@
|
|
ok sthen@
|
|
correctly - logically complete that now by removing MLINKS from base;
authors need only to ensure there is an entry in NAME for any function/
util being added. MLINKS will still work, and remain for perl to ease
upgrades;
ok nicm (curses) bcook (ssl)
ok schwarze, who provided a lot of feedback and assistance
ok tb natano jung
|
|
ok deraadt@, stsp@
|
|
idioms.
Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0)
where it is obvious further investigation will not yield and
even better way.
Obviousness evaluation and ok guenther@
|
|
okay jmc@
|
|
by POSIX and as FreeBSD, SunOS 10/11, and glibc also do it. Note
that an enquiry to the Austin Group led to the conclusion that this
change probably violates the C standard: C and POSIX unintentionally
conflict. But the POSIX behaviour makes more sense (easier to write
correct error handling code for it, and a lower risk that programs
miss errors) and is much more widespread, and the Austin Group
intends to approach the C committee in order to adjust the C standard.
See: http://austingroupbugs.net/view.php?id=1022
While here, do not set errno a second time, wcrtomb(3) already did that,
and it is required to do it by the standard.
OK millert@ and tedu@, and jca@ no longer objects
|
|
ok millert@
|
|
and when the file ends without a terminating Ln character,
fgetws(3) discarded any characters read and reported bogus EOF.
Never inspect errno(2) unless right after an error occurred!
OK millert@
|
|
1. When fprintf(fp, "...%ls...", ...) encounters an encoding error,
do not destroy all the fp->_flags, which made the file permanently
unreadable and unwriteable.
2. Do not change fp->_flags at all in case of encoding errors.
Neither the manual nor POSIX ask for it, no other conversions set the
error indicator, and it isn't needed because the return value reports
failure and must be checked anyway.
3. Detect failure in mbrtowc(3), do not silently treat invalid bytes
in the format string as the end of the format string.
4. Detect failure of __find_arguments(), no matter whether due to
out of memory conditions or encoding errors, and gracefully fail
rather than accessing an invalid pointer.
5. Remove the pointless and slightly dangerous errno = EILSEQ overrides
after functions that already do that and are required by the standard
to do so.
OK jca@ on items 1, 2, and 5.
OK millert@ on the complete diff.
"Completely brutal mix of bugs." deraadt@
|
|
ok and valuable input from millert@
|
|
encoding error occurs, so do it.
While here, do not set errno after mbrtowc(3) failure; mbrtowc(3)
already does that, and that behaviour is required by the standard.
ok jca@ guenther@ "nice find" deraadt@
|
|
|
|
Wrap __cxa_{atexit,finalize}() so the call from exit() goes direct
Switch regress/lib/libc/atexit/ to be built with -static so that it can
still access __atexit*
ok millert@ jca@
|
|
these functions return a negative value on failure.
OK doug@ deraadt@
|
|
and show this in the example.
|
|
exporting it)
|
|
case, by deleting some useless '& of an array' we also eliminate the need
for the casts which prompted the original lint warnings
ok deraadt@
|
|
ok millert@
|
|
|
|
|
|
C standard are all weak.
Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the
arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
|
|
and the symbols not in the C standard are weak
|
|
Delete unused 'fd' argument from internal function oldttyname()
|
|
|
|
wrapper .h files and asm labels to let internal calls resolve directly and
not be overridable or use the PLT. Then, apply that framework to most of
the functions in stdio.h, string.h, err.h, and wchar.h. Delete the
should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here.
tests clean on i386, amd64, sparc64, powerpc, and mips64
naming feedback from kettenis@ and millert@
ok kettenis@
|
|
symbols that are not longer exported. (This improves the generated code.)
ok deraadt@
|
|
malloc/calloc/realloc* returns.
|
|
available on more systems these days. OK deraadt@
|
|
ok miod@ millert@ krw@ guenther@
|
|
"and" and "or" to join sentence clauses, and you can use commas, but both hinders
reading;
|
|
From Ryan May.
|
|
time. Prodded by guenther@. Sorry.
|
|
|
|
Predefined strings are not very portable across troff implementations,
and they make the source much harder to read. Usually the intended
character can be written directly.
No output changes, except for two instances where the incorrect escape
was used in the first place.
tweaks + ok schwarze@
|
|
obsolete SIZE_T_MAX. OK miod@ beck@
|