summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-03-10 10:03:39 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-03-10 10:03:39 +0100
commitf8640490308f29de951b7b59f07be8b744f6e895 (patch)
treeb4c2af1c051f698b7c3ce50c2dfc96547c3e76b3 /src/main.c
parente522c4ea04e9d899907deb5d0304f7de0823e9da (diff)
Only set random seed once
Fixes non-random behaviour when randomizing file lists several times per second. Closes #349
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 840919f..534b89e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,6 +42,8 @@ int main(int argc, char **argv)
{
atexit(feh_clean_exit);
+ srand(getpid() * time(NULL) % ((unsigned int) -1));
+
setup_signal_handlers();
init_parse_options(argc, argv);