Skip to content

connection: Refactor 'add_gateway'

Grant Erickson connman 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3connection: Simplify exception handling in 'add_gateway'.src/connection.c+24 -230 replies
2/3connection: Change the function signature of 'add_gateway'.src/connection.c+18 -120 replies
3/3connection: Document 'add_gateway'.src/connection.c+53 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] connection: Refactor 'add_gateway'

This refactors the 'add_gateway' function by:

1. Leveraging early parameter checking, the 'g_autofree' pointer decoration, and the 'g_steal_pointer' macro to simplify exception handling.

2. Changing the function signature by migrating the return type to a double-pointer parameter and changing the return type to an 'int' for error status.

This allows passing the full range of failure errors to the caller and allows the caller to pass those errors directly along as their own return status.

In addition, this documents the function.

Grant Erickson (3):
connection: Simplify exception handling in 'add_gateway'.
connection: Change the function signature of 'add_gateway'.
connection: Document 'add_gateway'.

 src/connection.c | 124 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 92 insertions(+), 32 deletions(-)
Signature · 1 line
2.42.0