apps/sym: Read from the end of the file
This commit is contained in:
parent
68403dc029
commit
d30010d524
@ -141,5 +141,9 @@ int main()
|
||||
|
||||
fclose(new_stderr);
|
||||
|
||||
return 0;
|
||||
execv("/bin/sym", NULL);
|
||||
|
||||
perror("execv"); // If we're here, execv failed
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
sleep(6);
|
||||
sleep(2);
|
||||
|
||||
FILE* syms = fopen("/sys/moon.sym", "r");
|
||||
if (!syms)
|
||||
@ -13,15 +13,15 @@ int main()
|
||||
return 1;
|
||||
}
|
||||
|
||||
char buf[1025];
|
||||
char buf[1200];
|
||||
|
||||
if (fseek(syms, 8000, SEEK_SET) < 0)
|
||||
if (fseek(syms, -1199, SEEK_END) < 0)
|
||||
{
|
||||
perror("fseek");
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t nread = fread(buf, 1024, 1, syms);
|
||||
size_t nread = fread(buf, 1199, 1, syms);
|
||||
if (ferror(syms))
|
||||
{
|
||||
perror("fread");
|
||||
|
Loading…
Reference in New Issue
Block a user