FreeBSD/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
/**
 * Finalization routine for hrDeviceTable
 * It destroys the lists and frees any allocated heap memory
 */
Finalization routine for hrDeviceTable
It destroys the lists and frees any allocated heap memory
Finalization routine for hrDeviceTable It destroys the lists and frees any allocated heap memory
void
fini_device_tbl(void)
{
	struct device_map_entry *n1;
	if (devd_fd != NULL)
		fd_deselect(devd_fd);
	if (devd_sock != -1)
		(void)close(devd_sock);
	devinfo_free();
     	while ((n1 = STAILQ_FIRST(&device_map)) != NULL) {
		STAILQ_REMOVE_HEAD(&device_map, link);
		if (n1->entry_p != NULL) {
			TAILQ_REMOVE(&device_tbl, n1->entry_p, link);
			FREE_DEV_STRUCT(n1->entry_p);
		}
		free(n1->name_key);
		free(n1->location_key);
		free(n1);
     	}
	assert(TAILQ_EMPTY(&device_tbl));
}
void fini_device_tbl ( void ) { struct device_map_entry * n1 ; if ( devd_fd != NULL ) fd_deselect ( devd_fd ) ; if ( devd_sock != -1 ) ( void ) close ( devd_sock ) ; devinfo_free ( ) ; while ( ( n1 = STAILQ_FIRST ( & device_map ) ) != NULL ) { STAILQ_REMOVE_HEAD ( & device_map , link ) ; if ( n1 -> entry_p != NULL ) { TAILQ_REMOVE ( & device_tbl , n1 -> entry_p , link ) ; FREE_DEV_STRUCT ( n1 -> entry_p ) ; } free ( n1 -> name_key ) ; free ( n1 -> location_key ) ; free ( n1 ) ; } assert ( TAILQ_EMPTY ( & device_tbl ) ) ; }
Finalization routine for hrDeviceTable
 It destroys the lists and frees any allocated heap memory
Finalization routine for hrDeviceTable It destroys the lists and frees any allocated heap memory