]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pidfd-util: avoid alignment warning when accessing f_handle
authorJan Vaclav <jvaclav@redhat.com>
Tue, 20 May 2025 10:07:43 +0000 (12:07 +0200)
committerJan Vaclav <jvaclav@redhat.com>
Tue, 20 May 2025 10:07:43 +0000 (12:07 +0200)
src/basic/pidfd-util.c

index 52a371ba1aca7ed96f03f7df737fa031d110deab..54724a40b06a5eceb9596fff2b627bcdbd5759a2 100644 (file)
@@ -248,7 +248,7 @@ int pidfd_get_inode_id(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)
-                                *ret = *(uint64_t*) fh.file_handle.f_handle;
+                                *ret = *CAST_ALIGN_PTR(uint64_t, fh.file_handle.f_handle);
                         return 0;
                 }
                 assert(r != -EOVERFLOW);