changed calls to open() and creat()