utils: don't ignore open() return value
authorDaniel Golle <daniel@makrotopia.org>
Mon, 30 Aug 2021 23:35:53 +0000 (00:35 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 30 Aug 2021 23:46:49 +0000 (00:46 +0100)
commit86f82f3de1da07ef86a33a8e9302c98dafbfa6ec
treec59c3d75423ca17c5198a1f9b889fb46c0d3418d
parent8eb1d783cca6e0d501dd3a2f94262ffc36ae6482
utils: don't ignore open() return value

In case active console cannot be opened, return NULL early instead
of trying to read from errornous file descriptor.

Coverity CID: 1490087 Argument cannot be negative
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
utils/utils.c