Re: ipw srcipts for hal





On 6/25/07, yelo_3 <yelo_3 yahoo it> wrote:
ok but please add these:
1) an error message if the user didn't invoke the file correctly

already added in the cleaned up version I sended in my second mail.

2) a check to see if the setrfkill have not failed
if((fd=fopen(path,"rw"))==NULL) return -1;
fputc(argv[2][0],fd);
kill_status=fgetc(fd);
if (argv[2][0]!=kill_status) return -1;
fclose(fd);
g_free(path);

 this check wouldn't work. when you write a value to the file it can be 0,1,2 or 3 depending on the hwkillswitch and if it worked at all.

wouldn't it be better if instead of returning immediately error, we first try to set the values to all cards? this if the first card fails, but the second is ok, we don't prevent the second setting to be applied!
This could be done adding a flag error_occurred...

yes but what should  apps like nm do if we fail to disable all cards? wouldn't it be better to reneable the successful disabled ones to not confuse nm?
Dan what do you think?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]