Initialize fd to -1.