HomeClusterLabs Projects

Low: cib: avoid file descriptor leak on temporary file creation

Description

Low: cib: avoid file descriptor leak on temporary file creation

The previous lack of parentheses in this assignment plus test:

(new_fd = mkstemp(new) < 0)

meant that new_fd was always 0 (if mkstemp() succeeded) or 1 (if it failed).
The only practical effect was that the file descriptor would not be closed for
a successful creation (regression introduced in 1.1.13 via 006e98338).

Details

Provenance
kgaillotAuthored on Apr 4 2018, 8:07 PM
Parents
rPce06b7496076: Refactor: pengine: avoid redundant test
Branches
Unknown
Tags
Unknown

Event Timeline