Commit c2b1b7a
committed
Improves performance of some file operations, fixes some memory leaks, and increases clarity.
* Avoids unnecessary alarm(0) when it is about to be set again, only
cleans up after it’s all done.
* Renames DIRCHAR to LISPDIRCHAR to be more descriptive, adds LISPDIRSTR
for contexts where a string is required rather than a character.
* Avoids leaks of directory structures by ensuring that any opendir()
has a matching closedir(), with a timeout check, on the return path
* Ensures that closedir() calls that could smash errno happen after
errno is saved for Lisp’s consumption
* Simplifies code to take advantage of strlcpy()/strlcat() guarantee
that destination string is NUL terminated
* Reduces number of unnecessary copies into scratch buffer for file name
processing
* Removes some commented out code left over from copy/paste of functions1 parent d822d47 commit c2b1b7a
3 files changed
+82
-158
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
0 commit comments