Comment 3 for bug 607309

Revision history for this message
Vasily Kulikov (segooon) wrote :

Garo, as SF seems unresponsible for me I'll comment here. The patch is not full, it is still racy. There is still a period between file_exists() and fopen(). If conky is Linux only (I don't know) then the fix is a call to fopen() with "x" flag (glibc extension, not portable). Otherwise use open(2) with O_EXCL flag and either fdopen(3) + fwrite(3) + fclose(3) or write(2)+close(2).