Hello Michal, I have just a few nitpicks/comment to your patch.
On 06/23/2015 08:08 PM, Michal Židek wrote:
+#define MISSING_RESOLV_CONF_POLL_TIME 10
+static void missing_resolv_conf(struct tevent_context *ev,
struct tevent_timer *te,
struct timeval tv, void *data)
+{
- int ret;
- struct mt_ctx *ctx = talloc_get_type(data, struct mt_ctx);
- ret = monitor_config_file(ctx, ctx, RESOLV_CONF_PATH,
monitor_update_resolv, false);
- if (ret == EOK) {
signal_res_init(ctx);
- } if (ret == ENOENT) {
Did you want to write 'else if' ? (If 'if' is used on purpose then please add new line.)
tv = tevent_timeval_current_ofs(MISSING_RESOLV_CONF_POLL_TIME, 0);
te = tevent_add_timer(ctx->ev, ctx, tv, missing_resolv_conf, ctx);
if (te == NULL) {
DEBUG(SSSDBG_FATAL_FAILURE,
"tevent_add_timer failed. resolv.conf will be ignored.\n");
}
- } else if (ret != EOK) {
If my prev. comment is valid you should use else here, right?
DEBUG(SSSDBG_FATAL_FAILURE,
"Monitor_config_file failed. resolv.conf will be ignored.\n");
- }
- return;
Explicit return is in my opinion needless.
+}
Thanks!