open returns -1 on failure