Change in ...osmo-trx[master]: Transceiver: exit process when BTS drops connection

fixeria gerrit-no-reply at lists.osmocom.org
Mon Aug 26 14:20:00 UTC 2019


fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/15289 )

Change subject: Transceiver: exit process when BTS drops connection
......................................................................


Patch Set 3:

> I already had to fix some nasty deadlocks related to pthreads, destructors and exception handlers [...]

Well, I also fixed quite a lot of bugs in pure C code (e.g. in OsmoMSC, see release notes for 1.5.0) - does it mean we should stop using C and switch to something else (I vote for Erlang)?

This is a common pattern:

  if (error) {
    LOGP(SS, LEVEL, "Error message\n");
    return false; // or -ERRNO
  }

where you basically print a error message and break the execution flow.

Maybe I am missing something (given that my C++ experience is not that rich), but what's wrong with:

  if (error)
    throw "Error message";

and then:

  try {
    foo();
    // ...
  } catch (const char *e) {
    LOGP(SS, LEVEL, "Terminating process due to: %s\n", e);
  }


-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/15289
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I2ccbe3c17b39fb792ea7810f840235c348054d66
Gerrit-Change-Number: 15289
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Mon, 26 Aug 2019 14:20:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190826/cb8e4ffb/attachment.html>


More information about the gerrit-log mailing list