tree-wide: use new RET_NERRNO() helper at various places

This commit is contained in:
Lennart Poettering
2021-11-16 08:04:09 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent ef470ffa23
commit 7c248223eb
51 changed files with 151 additions and 469 deletions
+3 -11
View File
@@ -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) {