mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
Merge pull request #28308 from bluca/casting
Fix compilation on mipsel, ia64 and x32
This commit is contained in:
@@ -130,7 +130,7 @@ static uint64_t msr(uint64_t index) {
|
||||
index);
|
||||
return 0;
|
||||
} else if (rv != sizeof(ret)) {
|
||||
log_debug("Short read %ld bytes from MSR device %s (index %" PRIu64 "), ignoring",
|
||||
log_debug("Short read %zd bytes from MSR device %s (index %" PRIu64 "), ignoring",
|
||||
rv,
|
||||
MSR_DEVICE,
|
||||
index);
|
||||
|
||||
@@ -654,3 +654,17 @@ static inline ssize_t missing_getdents64(int fd, void *buffer, size_t length) {
|
||||
|
||||
# define getdents64 missing_getdents64
|
||||
#endif
|
||||
|
||||
/* ======================================================================= */
|
||||
|
||||
/* glibc does not provide clone() on ia64, only clone2(). Not only that, but it also doesn't provide a
|
||||
* prototype, only the symbol in the shared library (it provides a prototype for clone(), but not the
|
||||
* symbol in the shared library). */
|
||||
#if defined(__ia64__)
|
||||
int __clone2(int (*fn)(void *), void *stack_base, size_t stack_size, int flags, void *arg);
|
||||
#define HAVE_CLONE 0
|
||||
#else
|
||||
/* We know that everywhere else clone() is available, so we don't bother with a meson check (that takes time
|
||||
* at build time) and just define it. Once the kernel drops ia64 support, we can drop this too. */
|
||||
#define HAVE_CLONE 1
|
||||
#endif
|
||||
|
||||
@@ -1177,7 +1177,11 @@ pid_t clone_with_nested_stack(int (*fn)(void *), int flags, void *userdata) {
|
||||
mystack = (uint8_t*) mystack + ps; /* move pointer one page ahead since stacks usually grow backwards */
|
||||
mystack = (void*) ALIGN_TO((uintptr_t) mystack, ps); /* align to page size (moving things further ahead) */
|
||||
|
||||
#if HAVE_CLONE
|
||||
pid = clone(fn, mystack, flags, userdata);
|
||||
#else
|
||||
pid = __clone2(fn, mystack, ps, flags, userdata);
|
||||
#endif
|
||||
if (pid < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ static int run(int argc, char *argv[]) {
|
||||
"Failed to fstat(%s): %m",
|
||||
FORMAT_PROC_FD_PATH(STDERR_FILENO));
|
||||
|
||||
if (asprintf(&s, DEV_FMT ":" INO_FMT, st.st_dev, st.st_ino) < 0)
|
||||
if (asprintf(&s, DEV_FMT ":" INO_FMT, (dev_t)st.st_dev, st.st_ino) < 0)
|
||||
return log_oom();
|
||||
|
||||
if (setenv("JOURNAL_STREAM", s, /* overwrite = */ true) < 0)
|
||||
|
||||
@@ -53,8 +53,7 @@
|
||||
static SleepOperation arg_operation = _SLEEP_OPERATION_INVALID;
|
||||
|
||||
static int write_efi_hibernate_location(const HibernateLocation *hibernate_location, bool required) {
|
||||
int log_level = required ? LOG_ERR : LOG_DEBUG,
|
||||
log_level_ignore = required ? LOG_WARNING : LOG_DEBUG;
|
||||
int log_level = required ? LOG_ERR : LOG_DEBUG;
|
||||
|
||||
#if ENABLE_EFI
|
||||
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
|
||||
@@ -64,7 +63,7 @@ static int write_efi_hibernate_location(const HibernateLocation *hibernate_locat
|
||||
const char *uuid_str;
|
||||
sd_id128_t uuid;
|
||||
struct utsname uts = {};
|
||||
int r;
|
||||
int r, log_level_ignore = required ? LOG_WARNING : LOG_DEBUG;
|
||||
|
||||
assert(hibernate_location);
|
||||
assert(hibernate_location->swap);
|
||||
|
||||
Reference in New Issue
Block a user