From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] kernel/syscalls: add new test with 'open() + O_TMPFILE'
Date: Wed, 27 Jan 2016 14:22:05 +0100 [thread overview]
Message-ID: <20160127132205.GA29474@rei.lan> (raw)
In-Reply-To: <56A8B1ED.3080205@oracle.com>
Hi!
> >> +static int dir_not_empty(void)
> >> +{
> >> + struct dirent *entry;
> >> + DIR *dir = SAFE_OPENDIR(cleanup, test_dir);
> >> + int ret = 0;
> >> +
> >> + while ((entry = SAFE_READDIR(cleanup, dir)) != NULL) {
> >> + const char *file = entry->d_name;
> >> +
> >> + if (!strcmp(file, "..") || !strcmp(file, "."))
> >> + continue;
> >> +
> >> + tst_resm(TINFO, "found a file: %s", file);
> >> + ret = 1;
> >> + break;
> >> + }
> >> +
> >> + SAFE_CLOSEDIR(cleanup, dir);
> >> + return ret;
> >> +}
> > Maybe we should add this function to a library, since it's used at two
> > places allready.
>
> OK, tst_dir_is_empty(dir) is fine?
Fine with me.
--
Cyril Hrubis
chrubis@suse.cz
prev parent reply other threads:[~2016-01-27 13:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-30 10:33 [LTP] [PATCH] kernel/syscalls: add new test with 'open() + O_TMPFILE' Alexey Kodanev
2016-01-26 16:24 ` Cyril Hrubis
2016-01-27 12:02 ` Alexey Kodanev
2016-01-27 13:22 ` Cyril Hrubis [this message]
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=20160127132205.GA29474@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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.