mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
sysprofd: ftruncate() when overwriting files
This is really only used for proc like files which are generally a single page, but might as well start from zero.
This commit is contained in:
@ -78,6 +78,8 @@ file_set_contents_no_backup (const gchar *path,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ftruncate (fd, 0);
|
||||||
|
|
||||||
if (write (fd, contents, len) != len)
|
if (write (fd, contents, len) != len)
|
||||||
{
|
{
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
|
|||||||
Reference in New Issue
Block a user