[coreboot] [PATCH] flashrom: Call programmer_shutdown() where needed

Stefan Reinauer stepan at coresystems.de
Thu Jul 9 11:02:05 CEST 2009


Carl-Daniel Hailfinger wrote:
>> @@ -729,6 +730,7 @@
>>  		for (i = 0; i < ARRAY_SIZE(flashes) && flashes[i]; i++)
>>  			printf(" %s", flashes[i]->name);
>>  		printf("\nPlease specify which chip to use with the -c <chipname> option.\n");
>> +		programmer_shutdown();
>>  		exit(1);
>>   
>>     
>
> The repeated programmer_shutdown(); exit(1); pattern makes it clear that
> we need a function exit_and_shutdown(int exitcode). That function should
> replace exit() almost everywhere.
>   
Maybe programmer_shutdown should be hooked into the exit handler using
atexit(3)? I don't think it's necessary (nor desirable) to exchange
exit() by something else, given libc provides us some pretty nice
mechanisms here.

Stefan

-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.dehttp://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866





More information about the coreboot mailing list