remsim-client-shell: Terminate if STDIN has been closed

Change-Id: I39937224b06b6bb6f23c002023141882797ee6a6
changes/15/19315/1
Harald Welte 2 years ago
parent b80fcf0bd7
commit 3f65972ed6
  1. 4
      src/client/user_shell.c

@ -134,6 +134,10 @@ static int stdin_fd_cb(struct osmo_fd *ofd, unsigned int what)
rc = read(ofd->fd, cur, msgb_tailroom(ss->rx_msg));
if (rc < 0)
return rc;
if (rc == 0) {
fprintf(stderr, "STDIN was closed, terminating");
exit(0);
}
msgb_put(ss->rx_msg, rc);
for (i = 0; i < rc; i++) {

Loading…
Cancel
Save