X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=file_write.c;h=3f764766c39964a2f2736415a27cf56c4bad74ec;hp=32f6c3abdffdee58f8c4b49087c01b66c3909c1b;hb=4ca80f239ef2532dfe3af4013eb1d0cd38100185;hpb=35e284e06a5c8e20d02b61fdcb4bcc20b237c1e4 diff --git a/file_write.c b/file_write.c index 32f6c3ab..3f764766 100644 --- a/file_write.c +++ b/file_write.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2012 Andre Noll + * Copyright (C) 2006-2013 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -8,7 +8,6 @@ #include #include -#include #include "para.h" #include "list.h" @@ -38,10 +37,8 @@ struct private_file_write_data { __must_check __malloc static char *random_filename(void) { char *result, *home = para_homedir(); - struct timeval tv; - gettimeofday(&tv, NULL); - srandom(tv.tv_usec); + srandom(clock_get_realtime(NULL)->tv_usec); result = make_message("%s/.paraslash/%08lu", home, para_random(99999999)); free(home); @@ -110,7 +107,9 @@ static void file_write_post_select(__a_unused struct sched *s, char *buf; size_t bytes; - t->error = 0; + ret = task_get_notification(t); + if (ret < 0) + goto out; ret = btr_node_status(btrn, wn->min_iqs, BTR_NT_LEAF); if (ret <= 0) goto out;