mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-07-21 12:57:17 +00:00
logsys: detect write failure and avoid a file descriptor leak
* exec/logsys.c (logsys_log_rec_store): Close output file descriptor and detect any failure. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1915 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
dba6cd0859
commit
217c5bed8d
@ -1079,6 +1079,8 @@ int logsys_log_rec_store (char *filename)
|
||||
}
|
||||
|
||||
written_size = write (fd, flt_data, size_to_write);
|
||||
if (close (fd) != 0)
|
||||
return (-1);
|
||||
if (written_size < 0) {
|
||||
return (-1);
|
||||
} else if ((size_t)written_size != size_to_write) {
|
||||
|
Loading…
Reference in New Issue
Block a user