logctl: simplify and document a confusing function 06/196706/2 submit/tizen/20190107.090102
authorMichal Bloch <m.bloch@samsung.com>
Thu, 3 Jan 2019 15:53:34 +0000 (16:53 +0100)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 4 Jan 2019 02:01:29 +0000 (02:01 +0000)
commit89b29ddd964194772d4b4bbb32c82b4bbd9474f9
treecbdeff1a469e5ac2b557484ec97b8d75d6fb80d1
parent27657aea30fba6932c6d3ca87728adcef4c41aac
logctl: simplify and document a confusing function

  Minor behaviour change: all affected lines are now moved to the end,
  in the order they were specified in the kv struct (used to stay in
  place) and duplicate keys are pruned (used to be left alone).

  Example: kv pairs {"A", "1"} and {"B", "2"}, file:
    C=3
    B=8
    A=4
    B=6
    D=4

  Previously, the resulting file:
    C=3
    B=2
    A=1
    B=2
    D=4

  Now:
    C=3
    D=4
    A=1
    B=2

  This has no effect on configs because the order among different keys
  doesn't matter and a given key used to get the same value across copies,
  but allows to simplify some logic.

Change-Id: Ib2ac9e07dced12614cde000dc3876e2887410537
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/logctl/logctl.c