system environment judgment in apn_close()