Fix mkinitrd compile warnings.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-06-27 00:15:53 +02:00
parent 8318c51819
commit 39a8433b23
3 changed files with 4 additions and 1 deletions

View File

@ -78,7 +78,7 @@ bool CRC32File(uint32_t* result, const char* name, int fd, off_t offset,
const size_t BUFFER_SIZE = 16UL * 1024UL;
uint8_t buffer[BUFFER_SIZE];
off_t sofar = 0;
ssize_t amount;
ssize_t amount = 0;
while ( sofar < length &&
0 < (amount = pread(fd, buffer, BUFFER_SIZE, offset + sofar)) )
{

View File

@ -110,6 +110,7 @@ initrd_inode_t* CloneInode(const initrd_inode_t* src)
bool ReadInodeData(int fd, initrd_superblock_t* sb, initrd_inode_t* inode,
uint8_t* dest, size_t size)
{
(void) sb;
if ( inode->size < size ) { errno = EINVAL; return false; }
return preadall(fd, dest, size, inode->dataoffset) == size;
}
@ -247,6 +248,7 @@ void Help(FILE* fp, const char* argv0)
void Version(FILE* fp, const char* argv0)
{
(void) argv0;
fprintf(fp, "initrdfs 0.2\n");
fprintf(fp, "Copyright (C) 2012 Jonas 'Sortie' Termansen\n");
fprintf(fp, "This is free software; see the source for copying conditions. There is NO\n");

View File

@ -353,6 +353,7 @@ void Help(FILE* fp, const char* argv0)
void Version(FILE* fp, const char* argv0)
{
(void) argv0;
fprintf(fp, "mkinitrd 0.2\n");
fprintf(fp, "Copyright (C) 2012 Jonas 'Sortie' Termansen\n");
fprintf(fp, "This is free software; see the source for copying conditions. There is NO\n");