mirror of
				https://git.code.sf.net/p/linux-ima/ima-evm-utils
				synced 2025-11-04 06:40:49 +01:00 
			
		
		
		
	Use proper loff_t type for file size
Signed-off-byL Zbigniew Jasinski <z.jasinski@samsung.com> Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
This commit is contained in:
		
				
					committed by
					
						
						Dmitry Kasatkin
					
				
			
			
				
	
			
			
			
						parent
						
							7ece92b4e1
						
					
				
				
					commit
					3a1ef5f5c7
				
			@@ -152,19 +152,19 @@ int get_filesize(const char *filename)
 | 
				
			|||||||
	return (int)stats.st_size;
 | 
						return (int)stats.st_size;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline int get_fdsize(int fd)
 | 
					static inline off_t get_fdsize(int fd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct stat stats;
 | 
						struct stat stats;
 | 
				
			||||||
	/*  Need to know the file length */
 | 
						/*  Need to know the file length */
 | 
				
			||||||
	fstat(fd, &stats);
 | 
						fstat(fd, &stats);
 | 
				
			||||||
	return (int)stats.st_size;
 | 
						return stats.st_size;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int add_file_hash(const char *file, EVP_MD_CTX *ctx)
 | 
					static int add_file_hash(const char *file, EVP_MD_CTX *ctx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	uint8_t *data;
 | 
						uint8_t *data;
 | 
				
			||||||
	int err, size, bs = DATA_SIZE;
 | 
						int err, bs = DATA_SIZE;
 | 
				
			||||||
	size_t len;
 | 
						off_t size, len;
 | 
				
			||||||
	FILE *fp;
 | 
						FILE *fp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	data = malloc(bs);
 | 
						data = malloc(bs);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user