vfs_aio_fork: Use a shorter random delay
authorVolker Lendecke <vl@samba.org>
Mon, 11 Dec 2017 16:32:40 +0000 (17:32 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 12 Dec 2017 19:37:08 +0000 (20:37 +0100)
Otherwise the rw2 test takes ages for no good reason

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/modules/vfs_aio_fork.c

index 40fba4dbdc0e8359660d627c2b84bc4a6b3289ab..a0b1429132a78dad65a7f868b2ed1627d33a478d 100644 (file)
@@ -331,7 +331,7 @@ static void aio_child_loop(int sockfd, struct mmap_area *map)
                         * common parent state
                         */
                        generate_random_buffer(&randval, sizeof(randval));
                         * common parent state
                         */
                        generate_random_buffer(&randval, sizeof(randval));
-                       msecs = randval + 20;
+                       msecs = (randval%20)+1;
                        DEBUG(10, ("delaying for %u msecs\n", msecs));
                        smb_msleep(msecs);
                }
                        DEBUG(10, ("delaying for %u msecs\n", msecs));
                        smb_msleep(msecs);
                }