summaryrefslogtreecommitdiff
path: root/src/vconsole/vconsole-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vconsole/vconsole-setup.c')
-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) {