summaryrefslogtreecommitdiff
path: root/src/vconsole
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-11-14 22:40:49 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-11-16 08:04:09 +0100
commit7c248223ebafb9bfde9af978cd1ccfc57dcced26 (patch)
tree228bcda6699a2ae88ad01fd1f5f024f2b5d7b0a0 /src/vconsole
parentef470ffa234c8c824897488195fb2fc9a4a520e6 (diff)
downloadsystemd-7c248223ebafb9bfde9af978cd1ccfc57dcced26.tar.gz
tree-wide: use new RET_NERRNO() helper at various places
Diffstat (limited to 'src/vconsole')
-rw-r--r--src/vconsole/vconsole-setup.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index d1c3febdd5..50930d4af3 100644
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -20,6 +20,7 @@
#include "alloc-util.h"
#include "env-file.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "io-util.h"
@@ -40,13 +41,7 @@ static int verify_vc_device(int fd) {
TIOCL_GETFGCONSOLE,
};
- int r;
-
- r = ioctl(fd, TIOCLINUX, data);
- if (r < 0)
- return -errno;
-
- return r;
+ return RET_NERRNO(ioctl(fd, TIOCLINUX, data));
}
static int verify_vc_allocation(unsigned idx) {
@@ -54,10 +49,7 @@ static int verify_vc_allocation(unsigned idx) {
xsprintf(vcname, "/dev/vcs%u", idx);
- if (access(vcname, F_OK) < 0)
- return -errno;
-
- return 0;
+ return RET_NERRNO(access(vcname, F_OK));
}
static int verify_vc_allocation_byfd(int fd) {