libsysprof: fix various seek usage

This commit is contained in:
Christian Hergert
2019-05-28 19:45:08 -07:00
parent b1f58d6104
commit d55e36219c
2 changed files with 3 additions and 1 deletions

View File

@ -220,7 +220,7 @@ get_cpu_freq (SysprofHostinfoSource *self,
gchar buf[128];
gssize len;
lseek (freq->stat_fd, SEEK_SET, 0);
lseek (freq->stat_fd, 0, SEEK_SET);
len = read (freq->stat_fd, buf, sizeof buf - 1);
if (len > 0 && len < sizeof buf)

View File

@ -451,6 +451,8 @@ sysprof_symbol_map_serialize (SysprofSymbolMap *self,
g_string_chunk_clear (self->chunk);
g_hash_table_remove_all (self->lookasides);
lseek (fd, 0L, SEEK_SET);
return TRUE;
}