]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - file_write.c
Replace gettimeofday() by clock_gettime().
[paraslash.git] / file_write.c
index 13008c2dd4dcce7850b7fdd508dea827790d1787..3f764766c39964a2f2736415a27cf56c4bad74ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2012 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2013 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -8,7 +8,6 @@
 
 #include <regex.h>
 #include <sys/types.h>
-#include <sys/time.h>
 
 #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);