bpf: style fix in while(!feof()) loop
Use fgets() as the while loop condition. Signed-off-by: Chang-Hsien Tsai <luke.tw@gmail.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
e1afb70252
commit
92bd6820f2
@ -31,9 +31,7 @@ void kernel_syms_load(struct dump_data *dd)
|
||||
if (!fp)
|
||||
return;
|
||||
|
||||
while (!feof(fp)) {
|
||||
if (!fgets(buff, sizeof(buff), fp))
|
||||
break;
|
||||
while (fgets(buff, sizeof(buff), fp)) {
|
||||
tmp = reallocarray(dd->sym_mapping, dd->sym_count + 1,
|
||||
sizeof(*dd->sym_mapping));
|
||||
if (!tmp) {
|
||||
|
@ -30,9 +30,7 @@ int load_kallsyms(void)
|
||||
if (!f)
|
||||
return -ENOENT;
|
||||
|
||||
while (!feof(f)) {
|
||||
if (!fgets(buf, sizeof(buf), f))
|
||||
break;
|
||||
while (fgets(buf, sizeof(buf), f)) {
|
||||
if (sscanf(buf, "%p %c %s", &addr, &symbol, func) != 3)
|
||||
break;
|
||||
if (!addr)
|
||||
|
Loading…
Reference in New Issue
Block a user