mirror of
https://github.com/vivier/EMILE.git
synced 2024-06-12 03:29:30 +00:00
Correct lseek before writing
This commit is contained in:
parent
53f4028182
commit
87a4092549
|
@ -20,7 +20,6 @@ static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
|||
|
||||
int emile_first_set_param_scsi_extents( int fd, int drive_num, int second_offset, int size)
|
||||
{
|
||||
int fd;
|
||||
int ret;
|
||||
char first[1024];
|
||||
int current;
|
||||
|
@ -55,7 +54,7 @@ int emile_first_set_param_scsi_extents( int fd, int drive_num, int second_offset
|
|||
write_long((u_int32_t*)&first[1018], (size + BLOCK_SIZE - 1) / BLOCK_SIZE * BLOCK_SIZE);
|
||||
|
||||
ret = lseek(fd, location, SEEK_SET);
|
||||
if (ret != 0)
|
||||
if (ret != location)
|
||||
return EEMILE_CANNOT_WRITE_FIRST;
|
||||
|
||||
ret = write(fd, first, 1024);
|
||||
|
|
Loading…
Reference in New Issue
Block a user