define write fail return -1