tree-wide: use new RET_NERRNO() helper at various places
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
ef470ffa23
commit
7c248223eb
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user