1
0
mirror of https://github.com/systemd/systemd synced 2025-10-01 17:54:45 +02:00

Compare commits

..

No commits in common. "c24f405aceb37104c663da332ba9d66d19c0d72b" and "d9c23bcfc498bc6b8dcc50b7fc64db3082dcc8d7" have entirely different histories.

5 changed files with 7 additions and 13 deletions

View File

@ -30,7 +30,6 @@
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "unaligned.h"
#include "unit-name.h"
#include "user-util.h"
#include "xattr-util.h"
@ -39,7 +38,7 @@
typedef union {
struct file_handle file_handle;
uint8_t space[offsetof(struct file_handle, f_handle) + sizeof(uint64_t)];
} cg_file_handle;
} _alignas_(uint64_t) cg_file_handle;
#define CG_FILE_HANDLE_INIT \
(cg_file_handle) { \
@ -47,8 +46,7 @@ typedef union {
.file_handle.handle_type = FILEID_KERNFS, \
}
/* The .f_handle field is not aligned to 64bit on some archs, hence read it via an unaligned accessor */
#define CG_FILE_HANDLE_CGROUPID(fh) unaligned_read_ne64(fh.file_handle.f_handle)
#define CG_FILE_HANDLE_CGROUPID(fh) (*CAST_ALIGN_PTR(uint64_t, (fh).file_handle.f_handle))
int cg_path_open(const char *controller, const char *path) {
_cleanup_free_ char *fs = NULL;
@ -73,7 +71,7 @@ int cg_cgroupid_open(int cgroupfs_fd, uint64_t id) {
}
cg_file_handle fh = CG_FILE_HANDLE_INIT;
unaligned_write_ne64(fh.file_handle.f_handle, id);
CG_FILE_HANDLE_CGROUPID(fh) = id;
return RET_NERRNO(open_by_handle_at(cgroupfs_fd, &fh.file_handle, O_DIRECTORY|O_CLOEXEC));
}

View File

@ -16,7 +16,6 @@
#include "stat-util.h"
#include "stdio-util.h"
#include "string-util.h"
#include "unaligned.h"
static thread_local int have_pidfs = -1;
@ -240,7 +239,7 @@ int pidfd_get_inode_id_impl(int fd, uint64_t *ret) {
union {
struct file_handle file_handle;
uint8_t space[offsetof(struct file_handle, f_handle) + sizeof(uint64_t)];
} fh = {
} _alignas_(uint64_t) fh = {
.file_handle.handle_bytes = sizeof(uint64_t),
.file_handle.handle_type = FILEID_KERNFS,
};
@ -249,8 +248,7 @@ int pidfd_get_inode_id_impl(int fd, uint64_t *ret) {
r = RET_NERRNO(name_to_handle_at(fd, "", &fh.file_handle, &mnt_id, AT_EMPTY_PATH));
if (r >= 0) {
if (ret)
/* Note, "struct file_handle" is 32bit aligned usually, but we need to read a 64bit value from it */
*ret = unaligned_read_ne64(fh.file_handle.f_handle);
*ret = *CAST_ALIGN_PTR(uint64_t, fh.file_handle.f_handle);
return 0;
}
assert(r != -EOVERFLOW);

View File

@ -537,7 +537,7 @@ static int parse_one_option(const char *option) {
#if HAVE_OPENSSL
_cleanup_strv_free_ char **l = NULL;
l = strv_split(val, ":");
l = strv_split(optarg, ":");
if (!l)
return log_oom();

View File

@ -810,7 +810,7 @@ static int shovel_force(PTYForward *f) {
if (!f->master_hangup)
f->master_writable = f->master_readable = true;
if (!f->stdin_hangup && f->input_fd >= 0)
if (!f->stdin_hangup)
f->stdin_readable = true;
if (!f->stdout_hangup)
f->stdout_writable = true;

View File

@ -483,7 +483,6 @@ static int run(int argc, char **argv) {
assert_se(path_extract_directory(argv[0], &dir) >= 0);
#if HAVE_SECCOMP
if (geteuid() != 0 || !is_seccomp_available())
log_tests_skipped("Not privileged or seccomp is not available");
else {
@ -509,7 +508,6 @@ static int run(int argc, char **argv) {
_exit(EXIT_SUCCESS);
}
}
#endif
STRV_FOREACH(module, modules) {
r = test_one_module(dir, *module, names, addresses, n_addresses);