mirror of
https://github.com/vivier/EMILE.git
synced 2024-10-10 16:23:42 +00:00
open file on --test, check it can...
This commit is contained in:
parent
a7092964e5
commit
a67a546c6c
@ -554,18 +554,18 @@ int main(int argc, char **argv)
|
|||||||
printf("append: %s\n", append_string);
|
printf("append: %s\n", append_string);
|
||||||
printf("buffer size: %d\n", buffer_size);
|
printf("buffer size: %d\n", buffer_size);
|
||||||
|
|
||||||
|
/* set kernel info into second level */
|
||||||
|
|
||||||
|
fd = open(second_path, O_RDWR);
|
||||||
|
if (fd == -1)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "ERROR: cannot open \"%s\"\n",
|
||||||
|
second_path);
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
|
|
||||||
if (action_test == 0)
|
if (action_test == 0)
|
||||||
{
|
{
|
||||||
/* set kernel info into second level */
|
|
||||||
|
|
||||||
fd = open(second_path, O_RDWR);
|
|
||||||
if (fd == -1)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "ERROR: cannot open \"%s\"\n",
|
|
||||||
second_path);
|
|
||||||
return 15;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* set kernel info */
|
/* set kernel info */
|
||||||
|
|
||||||
ret = emile_second_set_kernel_scsi(fd, kernel_path);
|
ret = emile_second_set_kernel_scsi(fd, kernel_path);
|
||||||
@ -599,18 +599,22 @@ int main(int argc, char **argv)
|
|||||||
append_string, second_path);
|
append_string, second_path);
|
||||||
return 18;
|
return 18;
|
||||||
}
|
}
|
||||||
close(fd);
|
}
|
||||||
|
|
||||||
/* set second info in first level */
|
close(fd);
|
||||||
|
|
||||||
fd = open(first_path, O_RDWR);
|
/* set second info in first level */
|
||||||
if (fd == -1)
|
|
||||||
{
|
|
||||||
fprintf(stderr,
|
|
||||||
"ERROR: cannot open \"%s\".\n", first_path);
|
|
||||||
return 19;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fd = open(first_path, O_RDWR);
|
||||||
|
if (fd == -1)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"ERROR: cannot open \"%s\".\n", first_path);
|
||||||
|
return 19;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action_test == 0)
|
||||||
|
{
|
||||||
ret = emile_first_set_param_scsi(fd, second_path);
|
ret = emile_first_set_param_scsi(fd, second_path);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
@ -619,9 +623,12 @@ int main(int argc, char **argv)
|
|||||||
second_path, first_path);
|
second_path, first_path);
|
||||||
return 20;
|
return 20;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
if (action_test == 0)
|
||||||
|
{
|
||||||
/* copy first level to boot block */
|
/* copy first level to boot block */
|
||||||
|
|
||||||
ret = copy_file_to_bootblock(first_path, partition);
|
ret = copy_file_to_bootblock(first_path, partition);
|
||||||
|
Loading…
Reference in New Issue
Block a user