summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/getcap.c
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate more dead stores.wollman2009-11-251-3/+2
| | | | | Found by: Clang static analyzer MFC after: 7 days
* As the comment says, close() frees the variable, record. So we obtaindelphij2009-05-141-1/+1
| | | | | | | | the length by evaluating the value from the copy, cbuf instead. This fixes a crash caused by previous commit (use-after-free) Submitted by: Dimitry Andric <dimitry andric com> Pointy hat to: delphij
* Properly handle malloc() failures.delphij2009-04-021-5/+7
| | | | PR: bin/83338
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* In cgetmatch(3), return -1 if a NULL or 0-length name parameter is used.thomas2003-01-021-0/+3
| | | | | | | | | | | This situation most notably arises in chkprintcap, when a /etc/printcap entry has an empty rp= attribute. In that case, cgetmatch would enter an infinite loop if any entry in the file has multiple names. This causes lpd to hang at boot time on 5.0-DP2 when both conditions are met (:rp=: and multiple names -- not necessarily on the same entry). Reviewed by: roberto
* Silence casting away constness warnings.alfred2002-12-271-5/+12
| | | | | Make cgetmatch's locals const. Make cdbget take a const string and copy it into a buffer.
* Remove multi-line __P() usage.obrien2002-03-221-4/+5
|
* const poison just like NetBSD.imp2002-03-221-32/+14
|
* Fix SCM ID's.obrien2002-02-011-21/+21
|
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* Fix some error-handling logic so that ferror is called before fclose,gad2000-12-021-7/+21
| | | | | | | | | instead of immediately after the fclose. The previous logic did work on freebsd, but is somewhat risky practice (and causes trouble when porting to other OS's). PR: bin/22965 Reviewed by: Garrett Wollman
* Fix a memory leak in getent() that occurred when the requested entryhoek2000-05-211-1/+3
| | | | | | could not be found. PR: bin/17084
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),jasone2000-01-271-7/+7
| | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen
* Add three-tier symbol naming in support of POSIX thread cancellationjasone2000-01-121-7/+7
| | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read().
* Add unsigned char cast to isspace argache1999-11-041-1/+3
|
* Don't be so selective about which errors cause us to continue andimp1999-03-211-7/+2
| | | | | | | | which ones cause us to fail. Now all open errors on the databse file will cause the next file in the list to be tried. Submitted by: Arne Henrik Juul <arnej@math.ntnu.no> PR: 4585
* Replace memory leaking instances of realloc with non-leaking reallocf.imp1998-09-161-7/+7
| | | | | | | | | | | In some cases replace if (a == null) a = malloc(x); else a = realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is guaranteed to be the same thing. I've been running these on my system here w/o ill effects for some time. However, the CTM-express is at part 6 of 34 for the CAM changes, so I've not been able to do a build world with the CAM in the tree with these changes. Shouldn't impact anything, but...
* Change L_SET to SEEK_SET for POSIX compliance.jdp1997-10-261-1/+1
| | | | Submitted by: Dean Gaudet <dgaudet@arctic.org>
* Many places in the code NULL is used in integer context, wherephk1997-09-181-1/+1
| | | | | | | | | plain 0 should be used. This happens to work because we #define NULL to 0, but is stylistically wrong and can cause problems for people trying to port bits of code to other environments. PR: 2752 Submitted by: Arne Henrik Juul <arnej@imf.unit.no>
* Minor cleanup, mostly unused vars and missing #includes.phk1995-10-221-3/+0
|
* Remove trailing whitespace.rgrimes1995-05-301-27/+27
|
* Parse ^? now, our termcap use it and some termcaps from otherache1995-05-141-1/+5
| | | | systems use it too
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+1048
OpenPOWER on IntegriCloud