[CRIU] [PATCH] change the return value of get_fs_type from int to long.
Markus Knetschke
markus.knetschke at gmail.com
Fri Sep 16 12:20:21 PDT 2016
The field fs_type field of fd_parms is already long
Additionally the glibc man page says "Using unsigned int for such variables suffices on most systems." referring the minimum width of variables holding fs_type
There are already fs_types who sets the highest bit (CIFS, BTRFS HPFS...) which interfere with the error check in dump_one_reg_file_cond (fs_type < 0) through the cast into signed int and after this into long
Fixes error while dumping programs on a btrfs partition
Signed-off-by: Markus Knetschke <markus.knetschke at gmail.com>
---
criu/cr-dump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index f5fa730..04d19ac 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -229,7 +229,7 @@ static int fill_fd_params_special(int fd, struct fd_parms *p)
return 0;
}
-static int get_fs_type(int lfd)
+static long get_fs_type(int lfd)
{
struct statfs fst;
--
2.9.3
More information about the CRIU
mailing list