Now is alsactl restore <card> hhandled ok when configuration file doesn't exist...

This commit is contained in:
Jaroslav Kysela 1998-11-20 20:02:51 +00:00
parent fc7f1865ca
commit 18fa888b68
3 changed files with 5 additions and 5 deletions

View file

@ -116,7 +116,7 @@ static int store_setup( const char *cardname )
}
if ( (err = collect_all()) )
return err;
if ( (err = soundcard_setup_load( cfgfile )) )
if ( (err = soundcard_setup_load( cfgfile, 1 )) )
return err;
if ( (err = soundcard_setup_collect( cardno )) ) {
soundcard_setup_done();
@ -141,7 +141,7 @@ static int restore_setup( const char *cardname )
}
if ( (err = collect_all()) )
return err;
if ( (err = soundcard_setup_load( cfgfile )) )
if ( (err = soundcard_setup_load( cfgfile, 0 )) )
return err;
err = soundcard_setup_process( cardno );
soundcard_setup_done();

View file

@ -108,7 +108,7 @@ extern struct soundcard *soundcards;
void soundcard_setup_init( void );
void soundcard_setup_done( void );
int soundcard_setup_load( const char *filename );
int soundcard_setup_load( const char *filename, int skip );
int soundcard_setup_write( const char *filename );
int soundcard_setup_collect( int cardno );
int soundcard_setup_process( int cardno );

View file

@ -266,7 +266,6 @@ int soundcard_setup_collect( int cardno )
ctl -> no = idx;
if ( (err = snd_ctl_switch_read( handle, idx, &ctl -> s )) < 0 ) {
free( ctl );
snd_ctl_close( handle );
error( "CTL switch read error (%s) - skipping", snd_strerror( err ) );
break;
}
@ -499,7 +498,7 @@ int soundcard_setup_collect( int cardno )
return 0;
}
int soundcard_setup_load( const char *cfgfile )
int soundcard_setup_load(const char *cfgfile, int skip)
{
extern int yyparse( void );
extern int linecount;
@ -512,6 +511,7 @@ int soundcard_setup_load( const char *cfgfile )
#endif
if ( debugflag )
printf( "cfgfile = '%s'\n", cfgfile );
if (skip && access(cfgfile, R_OK)) return 0;
if ( ( yyin = fopen( cfgfile, "r" ) ) == NULL ) {
error( "Cannot open configuration file '%s'...", cfgfile );
return 1;