Skip to content

Commit fa2b8f6

Browse files
kolyshkinxemul
authored andcommitted
Use rlim_t where appropriate
I got the following then trying to compile CRIU on ARM with clang: > criu/cr-restore.c:2476:22: error: implicit conversion from 'unsigned > long long' to 'unsigned long' changes value from 18446744073709551615 to > 4294967295 [-Werror,-Wconstant-conversion] > return ival == -1 ? RLIM_INFINITY : ival; > ~~~~~~ ^~~~~~~~~~~~~ > /usr/include/arm-linux-gnueabihf/bits/resource.h:117:24: note: expanded > from macro 'RLIM_INFINITY' > # define RLIM_INFINITY 0xffffffffffffffffuLL > ^~~~~~~~~~~~~~~~~~~~~ > 1 error generated. Fix by using provided rlim_t type in this and similar places. travis-ci: success for Fixes to compile on arm with clang Signed-off-by: Kir Kolyshkin <[email protected]> Signed-off-by: Pavel Emelyanov <[email protected]>
1 parent ab83426 commit fa2b8f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

criu/cr-dump.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static int dump_task_fs(pid_t pid, struct parasite_dump_misc *misc, struct cr_im
309309
return pb_write_one(img_from_set(imgset, CR_FD_FS), &fe, PB_FS);
310310
}
311311

312-
static inline u_int64_t encode_rlim(unsigned long val)
312+
static inline rlim_t encode_rlim(rlim_t val)
313313
{
314314
return val == RLIM_INFINITY ? -1 : val;
315315
}

criu/cr-restore.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,7 @@ static int prep_sched_info(struct rst_sched_param *sp, ThreadCoreEntry *tc)
24712471
return 0;
24722472
}
24732473

2474-
static unsigned long decode_rlim(u_int64_t ival)
2474+
static rlim_t decode_rlim(rlim_t ival)
24752475
{
24762476
return ival == -1 ? RLIM_INFINITY : ival;
24772477
}

0 commit comments

Comments
 (0)