allow build_open_flags() to return an error