[Nut-upsdev] variable writability

Peter Selinger selinger at mathstat.dal.ca
Tue Oct 4 04:05:19 UTC 2005


Arnaud:

in today's commits, I removed three lines that you apparently added on
August 10:

1.1.1.1.8.1  (aquette  04-May-05):    if (mode == HU_WALKMODE_INIT)
1.1.1.1.8.1  (aquette  04-May-05):      {
1.1.1.1.8.1  (aquette  04-May-05):            dstate_setflags(item->info_type, item->info_flags);
1.1.1.1.8.6.2.5 (aquette  10-Aug-05):         /* Verify variable setability/RW */
1.1.1.1.8.6.2.5 (aquette  10-Aug-05):         if (get_current_data_attribute() != ATTR_DATA_CST)
1.1.1.1.8.6.2.5 (aquette  10-Aug-05):                 dstate_setflags(item->info_type, ST_FLAG_RW);
1.1.1.1.8.1  (aquette  04-May-05):      }

I think that these three lines are a bug, because they cause the
ST_FLAG_RW flag to be set on all variables, whether or not they are
declared writable. (Moreover, these lines *erase* the ST_FLAG_STRING
flag from all items).

I am just alerting you to this in case you had some particular
functionality in mind on August 10 when you added this code.  If yes,
then this functionality should probably be achieved by some other
means.

-- Peter




More information about the Nut-upsdev mailing list