X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=file_write.c;h=9a5ed5d7fab7dc01fe46fa5ecab6940ea3a28828;hb=refs%2Fheads%2Fpu;hp=64153178e969191201b869fe6bfa34f37f61af23;hpb=5967ac5353739c3ff571dd12d4c6814fa8493ad8;p=paraslash.git diff --git a/file_write.c b/file_write.c index 64153178..0a5d6bba 100644 --- a/file_write.c +++ b/file_write.c @@ -31,13 +31,8 @@ struct private_file_write_data { */ __must_check __malloc static char *random_filename(void) { - char *result, *home = para_homedir(); - srandom(clock_get_realtime(NULL)->tv_usec); - result = make_message("%s/.paraslash/%08ld", home, - para_random(99999999)); - free(home); - return result; + return make_message("%s/%08ld", get_confdir(), para_random(99999999)); } static int prepare_output_file(struct writer_node *wn) @@ -64,7 +59,7 @@ static int prepare_output_file(struct writer_node *wn) close(fd); return ret; } - pfwd = wn->private_data = para_calloc(sizeof(*pfwd)); + pfwd = wn->private_data = zalloc(sizeof(*pfwd)); pfwd->fd = fd; return 1; }