David, I have attached a patch, which cleans up some of the code I and
Roland changed recently.

Changes:
- white space changes, where spaces were used, but tabs intended
- sh_subtmpfile now uses F_dupfd_cloexec, saving one sys call
- sh_diropenat now takes a bool, instead of int, as xattr parameter
- sh_diropenat now uses F_dupfd_cloexec, saving a sys call
- use snprintf instead of sprintf in poll builtin, for security
- moved b_poll getopts string to data/bltins.c, for clean up
- error message "Can't obtain directory fd." now uses ERROR_system(1),
instead of ERROR_exit(1)
- calling a builtin, with O_SEARCH available, no longer calls stat() 2
times and then fchdir() if the cwd was moved by the builtin. I found,
that stat() will make a NFS client call the server each time, while
just doing the fchdir() does not. It is faster to just do the fchdir()
for all file systems I tested too, because stat() is slower than
fchdir(), and 2 stat() are much slower than 1 fchdir()

Olga
-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     olga.kryzhanov...@gmail.com   \-`\-'----.
 `'-..-| /       http://twitter.com/fleyta     \ |-..-'`
      /\/\     Solaris/BSD//C/C++ programmer   /\/\
      `--`                                      `--`

Attachment: fleyta_astksh_cleanup2.diff.gz
Description: GNU Zip compressed data

_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to