follow-up bit; ensure the mkstemp() file is unlinked
This commit is contained in:
+3
-1
@@ -416,8 +416,10 @@ int flg UNUSED;
|
|||||||
if (istemp) {
|
if (istemp) {
|
||||||
(void) snprintf(tmpfbuf, sizeof tmpfbuf, DATA_TEMPLATE, "mdXXXXXX");
|
(void) snprintf(tmpfbuf, sizeof tmpfbuf, DATA_TEMPLATE, "mdXXXXXX");
|
||||||
tmpfd = mkstemp(tmpfbuf);
|
tmpfd = mkstemp(tmpfbuf);
|
||||||
if (tmpfd >= 0)
|
if (tmpfd >= 0) {
|
||||||
rv = fdopen(tmpfd, WRTMODE); /* temp file is always read+write */
|
rv = fdopen(tmpfd, WRTMODE); /* temp file is always read+write */
|
||||||
|
Unlink(tmpfbuf);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
rv = fopen(name, mode);
|
rv = fopen(name, mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user