瀏覽代碼

pdb: check the result of setting the timeout via rpc

Daniel-Constantin Mierla 2 月之前
父節點
當前提交
5a74654e0b
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/modules/pdb/pdb.c

+ 4 - 1
src/modules/pdb/pdb.c

@@ -787,7 +787,10 @@ static void pdb_rpc_timeout(rpc_t *rpc, void *ctx)
 		return;
 	}
 
-	cfg_set_now_int(ctx, &gname, NULL, &vname, new_val);
+	if(cfg_set_now_int(ctx, &gname, NULL, &vname, new_val)) {
+		rpc->fault(ctx, 500, "Failed to set the new value");
+		return;
+	}
 }
 
 static void pdb_rpc_activate(rpc_t *rpc, void *ctx)