Commit Graph

27 Commits

Author SHA1 Message Date
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
mycroft 9a255f2ff2 Readd my change from fts.c rev 1.10, which was incorrectly removed in rev 1.19
(HI CHRISTOS!):
Avoid extra stat()s if a link count of 1 is returned for directories but the
d_type field is filled in.
1999-08-27 21:10:46 +00:00
mycroft 4c9100d48f Adjust fts_pow2() for LP64 before Ross bricks me. 1999-08-27 20:02:14 +00:00
mycroft ea03e67f3c GC one line of unneeded code. 1999-08-27 18:33:29 +00:00
mycroft 6b91e1fa70 Fix the comment above fts_palloc().
Also, fail with ENOMEM if fts_pathlen would overflow, rather than silently truncating the
path.
1999-08-27 18:29:08 +00:00
mycroft 8db2a166f9 Avoid memory leaks when realloc() fails (by storing the return value in a temporary, and
testing it before assigning it; fts_close(3) will deallocate the old memory).
1999-08-27 18:26:34 +00:00
mycroft b09ec9deb8 Fix multiple problems in the FTS_NOCHDIR case:
* There was an off-by-one error that caused the addition of a NUL or slash in fts_build() to
  overwrite other memory.
* After fts_palloc(), we need to reset `cp' so that it points to the new path name buffer;
  otherwise the addition of the file name before calling fts_stat() could lose.
Also, fix stupidity in the fts_palloc() interface.  We don't want N bytes more than the
current buffer size; we want N bytes more than the current length.  Just pass in the new
size, since we can't figure it out easily here.
1999-08-27 18:01:35 +00:00
mycroft ba3f600103 Allocate the path name buffer by powers of 2. 1999-08-27 06:17:33 +00:00
mycroft 8f599f97a7 Minor change to previous. 1999-08-26 20:28:53 +00:00
mycroft 8873459bcb Fix 3 bugs:
* When not using FTS_NOCHDIR, fts_accpath == fts_name.  fts_padjust should not
  try to move fts_accpath in this case.
* Previous entries at the same level also need to be adjusted.
* A bug was introduced in rev 1.8 (HI CHRISTOS!!) that caused the maxlen
  comparison to always fail (due to type promotions) when sp->fts_pathlen ==
  cur->fts_pathlen -- thus causing memory stompage.
1999-08-26 20:24:59 +00:00
christos 033ffd1215 make this compile under linux too. 1999-06-10 23:40:53 +00:00
christos 3eeda4afc6 Fix gcc-2.8.1 warnings. 1999-03-16 18:13:44 +00:00
thorpej cde86f7e7e Warn about references to the old fts functions, and direct the user to
include <fts.h> to generate the correct references.

Suggestion from Christoph Badura.
1998-12-01 20:13:47 +00:00
christos a5a8f8a117 delint 1998-11-12 16:19:42 +00:00
christos 5ba0b28730 qsort cast. 1998-11-06 19:44:03 +00:00
christos b34c5dd583 minor performance improvement. 1998-11-05 21:26:03 +00:00
christos c74a8268c0 rename len to dlen... 1998-11-05 13:57:22 +00:00
frueauf ac27d3aa85 Make this compile again: dp->dp_namlen -> dp->d_namlen. 1998-11-05 12:52:56 +00:00
christos f9c1a2b905 compile under svr4; no dp->d_namlen, and no whiteouts. 1998-11-03 14:47:03 +00:00
itohy 7b5b0b24ce Fix fts_close() not to (implicitly) read free()'ed memory.
This fix closes PR #6181.
1998-10-17 17:40:44 +00:00
thorpej e79648d085 Add some braces to make egcs happy. 1998-08-18 23:50:08 +00:00
perry 853e41b336 trivial changes to quiet lint. 1998-02-27 18:05:09 +00:00
perry 4146d58604 remove obsolete register declarations 1998-02-03 18:23:37 +00:00
thorpej 38ba03f125 Allow the old-name functions to be compiled from the same source file as
the renamed functions, and add some #error directives to force the
issue with weak symbols for renamed functions when we support weak
symbols in the C library.
1997-10-22 06:37:42 +00:00
fvdl 21e1e24df3 New hacks to make libc work painlessly without bumping the major number:
use type func(arg1s) asm("emitted_name") gcc mechanism.
Suggested by Bill Sommerfeld.
1997-10-22 00:51:45 +00:00
fvdl d6b51107ce Hacks to enable libc to work without bumping the major. 1997-10-21 00:55:10 +00:00