summaryrefslogtreecommitdiff
path: root/lib/libc/gen/err.c
Commit message (Collapse)AuthorAgeFilesLines
* warnx: fix needless staticWarner Losh2020-10-241-2/+2
| | | | | | | | | I noticed after the review that these shouldn't be static. Remove the 'static' from them, otherwise concurrent calls to warn* might see a similar but to the original. Notes: svn path=/head/; revision=366983
* warnx: Save errno across calls that might change it.Warner Losh2020-10-231-0/+8
| | | | | | | | | | | | | | | When warn() family of functions is being used after err_set_file() has been set to, for example, /dev/null, errno is being clobbered, rendering it unreliable after, for example, procstat_getpathname() when it is supposed to emit a warning. Then the errno is changed to Inappropriate ioctl for device, destroying the original value (via calls to fprintf()functions). Submitted by: Juraj Lutter Differential Revision: https://reviews.freebsd.org/D26871 Notes: svn path=/head/; revision=366982
* Clean up the vcs ID strings in libc's gen/ directory.John Baldwin2018-07-031-3/+1
| | | | | | | | | | | | | | | | | | | | - Move CSRG IDs into __SCCSID(). - When a file has been copied, consistently use 'From: <tag>' for strings referencing the version of the source file copied from in the license block comment. - Some of the 'From:' tags were using $FreeBSD$ that was being expanded on each checkout. Fix those to hardcode the FreeBSD tag from the file that was copied at the time of the copy. - When multiple strings are present list them in "chronological" order, so CSRG (__SCCSID) before FreeBSD (__FBSDID). If a file came from OtherBSD and contains a CSRG ID from the OtherBSD file, use the order CSRG -> OtherBSD -> FreeBSD. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15831 Notes: svn path=/head/; revision=335898
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0`Enji Cooper2017-05-231-4/+4
| | | | | | | | | | This is being done to aid humans and static analysis checkers. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318695
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* libc: replace 0 with NULL for pointers.Pedro F. Giffuni2016-04-101-4/+4
| | | | | | | | | | | | While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Reviewed by: bde (previous version - all new bugs are mine) Notes: svn path=/head/; revision=297790
* Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.Craig Rodrigues2015-09-201-4/+1
| | | | Notes: svn path=/head/; revision=288029
* Minor style(9) nit: move to using ANSI definition of functions.Warner Losh2008-04-031-19/+5
| | | | Notes: svn path=/head/; revision=177893
* Per Regents of the University of Calfornia letter, remove advertisingWarner Losh2007-01-091-4/+0
| | | | | | | | | clause. # If I've done so improperly on a file, please let me know. Notes: svn path=/head/; revision=165903
* Do not use __progname directly (except in [gs]etprogname(3)).Mark Murray2002-03-291-8/+7
| | | | | | | | | Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland. Notes: svn path=/head/; revision=93399
* Fix the style of the SCM ID's.David E. O'Brien2002-03-221-3/+0
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* Fixed tab lossage in vendor id and nearby style bugs in previous commit.Bruce Evans2002-02-011-1/+4
| | | | Notes: svn path=/head/; revision=90096
* Cut-n-paste in `list' mode considered harmful.David E. O'Brien2002-02-011-3/+3
| | | | Notes: svn path=/head/; revision=90049
* Fix SCM ID's.David E. O'Brien2002-02-011-5/+5
| | | | Notes: svn path=/head/; revision=90039
* Fixed namespace pollution related to `err' in libc in the same way as forBruce Evans2001-11-111-1/+3
| | | | | | | | | | | `warn'. Now a whole 2 members of the err() family don't cause pollution. This fixes world breakage in awk for NOSHARED worlds. contrib/awk/msg.c has had its own version of err() for a long time, but this somehow didn't cause problems until the update to awk-3.1.0. Notes: svn path=/head/; revision=86250
* Fixed namespace pollution related to `warn' in libc (but not in otherBruce Evans2001-08-291-1/+5
| | | | | | | | | libraries or for other members of the err() family). This fixes world breakage in bc and rcs/* for NOSHARED worlds. Notes: svn path=/head/; revision=82496
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Replace accidentally-deleted `x' which caused warnx() to misbehave.Garrett Wollman1998-09-151-2/+2
| | | | Notes: svn path=/head/; revision=39202
* A small last-minute iitem for 3.0:Garrett Wollman1998-09-121-75/+67
| | | | | | | | | | | | - Fix some style errors I made back in 1995. - Add a new flavor of the err(3) family, which takes an explicit errno argument rather than implicitly examining errno. This will make it easier to use these functions in conjunction with modern library interfaces that return an errno value explicitly. Notes: svn path=/head/; revision=39112
* Don't use __dead or __pure in user code. They were obfuscationsBruce Evans1996-09-141-4/+4
| | | | | | | | | for gcc >= 2.5 and no-ops for gcc >= 2.6. Converted to use __dead2 or __pure2 where it wasn't already done, except in math.h where use of __pure was mostly wrong. Notes: svn path=/head/; revision=18286
* Add err_set_file() and err_set_exit() functions to make it possible forGarrett Wollman1995-04-131-14/+44
| | | | | | | | programs which use err(3) to work nicely in a wider range of environments (e.g., dialog). Notes: svn path=/head/; revision=7803
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+186
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573