Le 8 mai 2011 à 02:51, Olaf van der Spek a écrit :

> On Sun, May 8, 2011 at 12:00 AM, Daniel Nichter <[email protected]> wrote:
>> Hello,
>> 
>> I have a working plugin which I'll push to Launchpad soon.  I have a 
>> question about using the update_func_arg of class sys_var_std_string to 
>> create a dynamic variable.  My plugin's class has a file descriptor to the 
>> open query log file, but the update function can't access it because it 
>> doesn't receive a pointer to the plugin's class.  I can make the file 
>> descriptor var global in my plugin's namespace, but I'd like to keep 
>> everything inside the class.  Is this possible?  I tried hacking and casting 
>> and passing a pointer to a non-static member function of the class, but I 
>> couldn't get that to work.  My update function is currently:
>> 
>> bool update_file(Session *, set_var *var)
>> {
>>  const char *new_file= var->value->str_value.ptr();
>> 
>>  if (fd)
>>    close(fd);
>>  fd= open_log_file(new_file);
>>  if (fd < 0)
>>    return false;  // error
>> 
>>  sysvar_file= new_file;
>> 
>>  return false;  // success
>> }
> 
> What does return false; mean? Error or success? ;)

Ah nice catch.  I was playing with, breaking my code.  It's really return true; 
// error  and return false; // success

-Daniel


_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to