mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +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;
|
||||
}
|
||||
|
||||
ftruncate (fd, 0);
|
||||
|
||||
if (write (fd, contents, len) != len)
|
||||
{
|
||||
int errsv = errno;
|
||||
|
||||
Reference in New Issue
Block a user