summaryrefslogtreecommitdiffstats
path: root/mbbsd/vote.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/vote.c')
-rw-r--r--mbbsd/vote.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mbbsd/vote.c b/mbbsd/vote.c
index 39c5eb67..8eb2c756 100644
--- a/mbbsd/vote.c
+++ b/mbbsd/vote.c
@@ -144,7 +144,8 @@ vote_report(const char *bname, const char *fname, char *fpath)
dtime = now;
for (;;) {
- sprintf(ip, "M.%d.A", (int)++dtime);
+ /* TODO: extract record.c:stampfile_u() to common lib */
+ sprintf(ip, "M.%d.A.%3.3X", (int)++dtime, (unsigned int)(random() & 0xFFF));
fd = open(fpath, O_CREAT | O_EXCL | O_WRONLY, 0644);
if (fd >= 0)
break;
@@ -152,6 +153,7 @@ vote_report(const char *bname, const char *fname, char *fpath)
}
close(fd);
+ /* XXX: FIXME: Possible race condition */
unlink(fpath);
link(fname, fpath);