Commit Graph

8 Commits

Author SHA1 Message Date
Warner Losh
e8420087b0 Replace memory leaking instances of realloc with non-leaking reallocf.
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...
1998-09-16 04:17:47 +00:00
John Birrell
84d6500535 Cast pointer to a long instead of an int to keep a 64-bit compiler
happy. The code works either way, but I like a clean compile.
1998-03-09 04:29:00 +00:00
Bruce Evans
03dcee8db1 Fixed errors in the Lite2 merge. Some style changes were mismerged.
My changes to preserve errno across free() and close() and to report
fstat() errors properly were blown away.

Updated the FreeBSD changes to match the Lite2 style fixes.
1997-03-12 12:35:44 +00:00
Peter Wemm
adf6ad9e69 Merge from Lite2:
filesystem include updates, duplicate group suppression, cleanups,
  filesystem whiteout support (unionfs), bidir popen().
1997-03-11 11:52:33 +00:00
Poul-Henning Kamp
d71458ee72 Cache the result of getpagesize() so we only make one syscall.
Use getpagesize instead of CLBYTES.
1996-05-02 08:43:05 +00:00
Bruce Evans
0b50c8d653 stat() before open() because opening of special files may be harmful. 1996-03-29 12:55:54 +00:00
Bruce Evans
55e2b2c608 Fix bugs in opendir():
- it succeeded on non-directories (see POSIX 5.1.2.4).
- it hung on (non-open) named pipes.
- it leaked memory if the second malloc() failed.
- it didn't preserve errno across errors in close().
1995-04-21 15:23:27 +00:00
Rodney W. Grimes
58f0484fa2 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00