From: Sami Kerola Date: Mon, 12 Sep 2011 20:01:03 +0000 (+0200) Subject: ipcmk: allow high speed ipc creation X-Git-Tag: v2.21-rc1~402^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b332ef44cfaf226140c7e47e4fefbbe602676519;p=thirdparty%2Futil-linux.git ipcmk: allow high speed ipc creation This commit will allow user to create quickly plenty of ipc resources. Earlier the line bellow gave no satisfaction. for i in $(seq 0 42); do ipcmk -Q; done Signed-off-by: Sami Kerola --- diff --git a/sys-utils/ipcmk.c b/sys-utils/ipcmk.c index b4bc5be197..c91908bde8 100644 --- a/sys-utils/ipcmk.c +++ b/sys-utils/ipcmk.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "c.h" #include "nls.h" @@ -36,7 +36,9 @@ key_t create_key(void) { - srandom(time(NULL)); + struct timeval now; + gettimeofday(&now, NULL); + srandom(now.tv_usec); return random(); }