open: preserve error on failed open
write: handle offset correctly for fswrite
2 files changed