fix a typo and init st_flags for devnull case