From: Tommi Rantala <tt.rantala@gmail.com>
To: davej@redhat.com
Cc: trinity@vger.kernel.org, Tommi Rantala <tt.rantala@gmail.com>
Subject: [PATCH 3/8] Avoid needless get_filename() calls in generate_pathname()
Date: Sun, 30 Jun 2013 22:33:07 +0300 [thread overview]
Message-ID: <1372620792-16384-4-git-send-email-tt.rantala@gmail.com> (raw)
In-Reply-To: <1372620792-16384-1-git-send-email-tt.rantala@gmail.com>
---
files.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/files.c b/files.c
index 89a11d4..3319eef 100644
--- a/files.c
+++ b/files.c
@@ -363,13 +363,13 @@ char * generate_pathname(void)
case 0 ... 90:
/* 90% chance of returning an unmangled filename */
if ((rand() % 100) > 10)
- return get_filename();
+ return pathname;
case 91 ... 99:
/* Create a bogus filename. */
newpath = malloc(page_size); // FIXME: We leak this.
if (newpath == NULL)
- return get_filename(); // give up.
+ return pathname; // give up.
generate_random_page(newpath);
--
1.8.1.4
next prev parent reply other threads:[~2013-06-30 19:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-30 19:33 [PATCH 0/8] misc trinity patches Tommi Rantala
2013-06-30 19:33 ` [PATCH 1/8] Use TRINITY_PF_MAX instead of PF_MAX in syscalls/socket.c Tommi Rantala
2013-06-30 19:33 ` [PATCH 2/8] Fix open() result check in check_tainted() Tommi Rantala
2013-06-30 19:33 ` Tommi Rantala [this message]
2013-06-30 19:33 ` [PATCH 4/8] Fix double rand() in generate_pathname() Tommi Rantala
2013-06-30 19:33 ` [PATCH 5/8] move perf_event.h to include/ Tommi Rantala
2013-06-30 23:29 ` Dave Jones
2013-07-01 14:35 ` Tommi Rantala
2013-07-01 14:43 ` Dave Jones
2013-07-01 15:30 ` Vince Weaver
2013-06-30 19:33 ` [PATCH 6/8] msgrcv() and msgsnd() IPC_NOWAIT msgflg Tommi Rantala
2013-06-30 19:33 ` [PATCH 7/8] ioctls/drm: add deprecated nouveau ioctls Tommi Rantala
2013-06-30 19:33 ` [PATCH 8/8] ioctls/vhost: VHOST_SCSI_* ioctls Tommi Rantala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372620792-16384-4-git-send-email-tt.rantala@gmail.com \
--to=tt.rantala@gmail.com \
--cc=davej@redhat.com \
--cc=trinity@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.