[Asterisk-code-review] stasis recording/stored: remove calls to deprecated readdir ... (asterisk[13])

Corey Farrell asteriskteam at digium.com
Thu Nov 3 11:10:56 CDT 2016


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/4224 )

Change subject: stasis_recording/stored: remove calls to deprecated readdir_r function.
......................................................................


Patch Set 4:

> > Wouldn't this iterate everything in /tmp?
 > 
 > It will. I had it do that so it would iterate over more files in
 > the parent directory and potentially different ones at that each
 > time.
 > 
 > That being said I don't mind limiting the scope of the search. It
 > should make the test more deterministic (no potential outside
 > changing variables).

I'd rather it be deterministic.  Also when this test is run under non-root we do not want it to produce logger error's when it fails to opendir on a directory with ownership=root:root and permissions=700.

You are using mkstemp to produce the files, so you are getting different filenames each time.  If you wanted to have a different number of files per run I wouldn't object to using ast_random() in the initialization of num_files.

Maybe:
/* Randomly test against 10-19 files */
const int num_files = 10 + (ast_random() % 10);

-- 
To view, visit https://gerrit.asterisk.org/4224
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id8f54689b1e2873e82a09d0d0d2faf41964e80ba
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list