[PATCH] one more hdparm patch with command line parsing bug fix

Tito farmatito at tiscali.it
Sat May 13 21:01:37 UTC 2006


On Saturday 13 May 2006 22:04, you wrote:
> On Sat, May 13, 2006 at 09:24:48PM +0200, Tito wrote:
> >On Saturday 13 May 2006 18:43, Bernhard Fischer wrote:
> >> 

BTW:

+#define opt_noisy                      (1<<0)
+#define opt_verbose                    (1<<1)
+#define opt_get_identity       (1<<2)
+#define opt_get_geom           (1<<3)
+#define opt_quiet                      (1<<4)
+#define opt_do_flush           (1<<5)
+#define opt_do_ctimings                (1<<6)
+#define opt_do_timings         (1<<7)

by doing this for all the options don't we risk to overflow static unsigned int opts = 1; /* noisy is on */
as this was the problem that made impossible to use bb_getoptulflags without additonal patches from
vodz and even with them it was very problematic.

Think that we have to manage 38 options

#define opt_38th      (1<<37)  ??? is this ok

Ciao,
Tito


> 
> The set_* get_* should be treated the same way, i.e just mask the bits
> which are set and use one unsigned long flgs or something like this.
> 
> Feel free to incooperate any of these changes into your patch.
> 
> Cheers and sorry for being grumpy
> 



More information about the busybox mailing list