e1_recorder: propagate errors to main, where we exit() in case of failing to open file
This commit is contained in:
parent
df7a306df5
commit
2ac78497dd
|
@ -32,10 +32,15 @@ void e1ts_raw_recv(struct e1inp_ts *ts, struct msgb *msg)
|
||||||
{
|
{
|
||||||
struct e1_recorder_line *rline = &g_recorder.line[ts->line->num];
|
struct e1_recorder_line *rline = &g_recorder.line[ts->line->num];
|
||||||
enum osmo_e1cap_capture_mode cap_mode = ts2cap_mode(ts);
|
enum osmo_e1cap_capture_mode cap_mode = ts2cap_mode(ts);
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* FIXME: special processing of TFP and PGSL */
|
/* FIXME: special processing of TFP and PGSL */
|
||||||
|
|
||||||
e1frame_store(ts, msg, cap_mode);
|
rc = e1frame_store(ts, msg, cap_mode);
|
||||||
|
if (rc < 0) {
|
||||||
|
LOGP(DMAIN, LOGL_FATAL, "Error writing E1/T1 frame to disk\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (rline->mirror.enabled) {
|
if (rline->mirror.enabled) {
|
||||||
struct e1inp_line *other_line =
|
struct e1inp_line *other_line =
|
||||||
|
|
|
@ -83,7 +83,9 @@ int e1frame_store(struct e1inp_ts *ts, struct msgb *msg, enum osmo_e1cap_capture
|
||||||
h->capture_mode = mode;
|
h->capture_mode = mode;
|
||||||
h->flags = 0;
|
h->flags = 0;
|
||||||
|
|
||||||
storage_reopen_if_needed();
|
rc = storage_reopen_if_needed();
|
||||||
|
if (rc < 0)
|
||||||
|
return rc;
|
||||||
|
|
||||||
rc = writev(g_out_fd, iov, ARRAY_SIZE(iov));
|
rc = writev(g_out_fd, iov, ARRAY_SIZE(iov));
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
|
Loading…
Reference in New Issue