Hm, okay.  I took the printf() lines almost verbatim from bgpctl.c,
which seems to use printf() throughout, as does relayctl.c.  So, I
just sort of followed the convention that was already there.  Should
they be using the log functions instead?  I can fix my diff (and the
other printf()'s in relayctl.c) if that's the case.

Thanks,

--
Seth



On Thu, Dec 1, 2011 at 6:25 AM, Pierre-Yves Ritschard <[email protected]>
wrote:
> do not use printf, use the log functions this code path might (and
> will) happen in places where there's no stdout.
>
>>        case LOAD:
>>                imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, -1,
>>                    res->path, strlen(res->path));
>> +               printf("load request sent.\n");
>>                done = 1;
>>                break;
>>        case RELOAD:
>>                imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, -1, NULL, 0);
>> +               printf("reload request sent.\n");
>>                done = 1;
>>                break;
>>        case MONITOR:
>> Index: relayd/relayd.c
>> ===================================================================
>> RCS file: /cvs/src/usr.sbin/relayd/relayd.c,v
>> retrieving revision 1.104
>> diff -u -p -r1.104 relayd.c
>> --- relayd/relayd.c     4 Sep 2011 20:26:58 -0000       1.104
>> +++ relayd/relayd.c     10 Nov 2011 16:53:20 -0000
>> @@ -335,6 +335,12 @@ parent_reload(struct relayd *env, u_int
>>
>>        log_debug("%s: level %d config file %s", __func__, reset,
filename);
>>
>> +       if (parse_config(filename, env) == -1) {
>> +               log_warnx("config file %s has errors, not reloading",
>> +                   filename);
>> +               return;
>> +       }
>> +
>>        config_purge(env, CONFIG_ALL);
>>
>>        if (reset == CONFIG_RELOAD) {

Reply via email to