busybox-1.32.0/networking/ifupdown.c
static llist_t *read_iface_state(void)
{
	llist_t *state_list = NULL;
	FILE *state_fp = fopen_for_read(IFSTATE_FILE_PATH);

	if (state_fp) {
		char *start, *end_ptr;
		while ((start = xmalloc_fgets(state_fp)) != NULL) {
			/* We should only need to check for a single character */
			end_ptr = start + strcspn(start, " \t\n");
			*end_ptr = '\0';
			llist_add_to(&state_list, start);
		}
		fclose(state_fp);
	}
	return state_list;
}
/* read the previous state from the state file */
read the previous state from the state file
read the previous state from the state file
static llist_t *read_iface_state(void)
{
	llist_t *state_list = NULL;
	FILE *state_fp = fopen_for_read(IFSTATE_FILE_PATH);
	if (state_fp) {
		char *start, *end_ptr;
		while ((start = xmalloc_fgets(state_fp)) != NULL) {
			end_ptr = start + strcspn(start, " \t\n");
			*end_ptr = '\0';
			llist_add_to(&state_list, start);
		}
		fclose(state_fp);
	}
	return state_list;
}
static llist_t * read_iface_state ( void ) { llist_t * state_list = NULL ; FILE * state_fp = fopen_for_read ( IFSTATE_FILE_PATH ) ; if ( state_fp ) { char * start , * end_ptr ; while ( ( start = xmalloc_fgets ( state_fp ) ) != NULL ) { end_ptr = start + strcspn ( start , " \t \n " ) ; * end_ptr = ' \0 ' ; llist_add_to ( & state_list , start ) ; } fclose ( state_fp ) ; } return state_list ; }
read the previous state from the state file
read the previous state from the state file
/* We should only need to check for a single character */