Commit Graph

16 Commits

Author SHA1 Message Date
christos
4a87bdacc7 read returns ssize_t, and err is a function name. 2012-04-07 16:17:17 +00:00
lukem
c5eb4ab601 fix -Wsign-compare issues 2009-01-18 11:56:51 +00:00
christos
6b99850ef0 Coverity CID 1209: Avoid negative close. While I am there fix bugs (open
returning 0 is ok). Reorganize code to factor out common parts, cleanup
syscall checking and error code return.
2006-03-19 21:55:37 +00:00
elad
232f61fabb Lint warnings. 2005-08-27 16:55:59 +00:00
salo
99410184e7 netbsd.org->NetBSD.org 2003-07-26 19:24:24 +00:00
christos
63c4aa480d PR/7885: Kip Rugger: ttylock(3) ignores flags and locker parameters 2003-04-21 00:39:40 +00:00
itojun
5d1183fefb use strlcpy/cat 2002-11-16 23:30:32 +00:00
ad
fce98185a9 - __RCSID() police.
- ANSIfy.
- Miscellaneous style changes.
- Shutup lint(1) in one or two cases.
2000-07-05 11:46:40 +00:00
lukem
d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem
b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
kleink
66208204f2 In userland, pull in <errno.h> instead of <sys/errno.h> for the declaration
of errno.
1999-01-11 23:20:35 +00:00
christos
983a6b1f22 Delint 1998-12-09 14:35:02 +00:00
mrg
2beab49a06 - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:45:41 +00:00
mycroft
c967784829 Test file type correctly, using S_IS*(). 1997-10-19 18:10:58 +00:00
cjs
8e29c9888e * Add hostname to temporary file to avoid collisions when locking on
an NFS volume and competing with the same pid on another machine.
* Make locking on an NFS-moutned file work properly by checking link
count.
* Make sure correct errno is returned.
1997-10-12 09:58:23 +00:00
cjs
09ced7933a Add pidlock, ttylock, ttyunlock functions. 1997-10-11 02:56:22 +00:00