save and restore errno where necessary
1 file changed