Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Issue 2411833004: Replace some deprecated usages of readdir_r with readdir (Closed)

Created:
4 years, 2 months ago by fwang
Modified:
4 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, rickyz+watch_chromium.org, gavinp+disk_chromium.org, jln+watch_chromium.org, kinuko+cache_chromium.org, tonikitoo, rjkroege, kylechar, raymes, bbudge, Roland McGrath
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace some deprecated usages of readdir_r with readdir readdir_r is deprecated and using it with recent compilers cause some warning that may be treated as build errors. readdir is recommended instead, see http://man7.org/linux/man-pages/man3/readdir_r.3.html This CL replaces some usages of readdir_r with readdir in order to fix build errors with use_ozone=1. R=jln@chromium.org,gavinp@chromium.org,dcheng@chromium.org BUG=457759 Committed: https://crrev.com/c2fdc2710b700158ad46111be664eac7ede0fdce Cr-Commit-Position: refs/heads/master@{#428867}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add comments about the thread-safety of readdir calls. #

Patch Set 3 : Fix formatting in sandbox/linux/services/proc_util.cc. #

Patch Set 4 : Keep readdir_r in proc_util.cc when OS_NACL_NONSFI is defined. #

Total comments: 2

Patch Set 5 : Address review comments by Jorge Lucangeli Obes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -16 lines) Patch
M base/files/file_enumerator_posix.cc View 1 1 chunk +5 lines, -3 lines 0 comments Download
M net/disk_cache/simple/simple_index_file_posix.cc View 1 1 chunk +10 lines, -6 lines 0 comments Download
M sandbox/linux/services/proc_util.cc View 1 2 3 4 2 chunks +25 lines, -7 lines 0 comments Download

Messages

Total messages: 54 (19 generated)
fwang
Patch is untested. Note that this is also related to https://bugs.chromium.org/p/chromium/issues/detail?id=457759
4 years, 2 months ago (2016-10-12 14:19:55 UTC) #1
dcheng
My main concern is the thread-safety of readdir. The man page you linked notes that ...
4 years, 2 months ago (2016-10-12 21:01:55 UTC) #2
bungeman-chromium
On 2016/10/12 21:01:55, dcheng wrote: > My main concern is the thread-safety of readdir. The ...
4 years, 2 months ago (2016-10-12 21:22:02 UTC) #3
gavinp
net/ lgtm
4 years, 2 months ago (2016-10-13 20:17:20 UTC) #4
dcheng
base LGTM
4 years, 2 months ago (2016-10-13 23:03:04 UTC) #5
fwang
Can someone please review sandbox/linux/services/proc_util.cc ?
4 years, 2 months ago (2016-10-19 07:52:10 UTC) #8
Jorge Lucangeli Obes
https://codereview.chromium.org/2411833004/diff/1/sandbox/linux/services/proc_util.cc File sandbox/linux/services/proc_util.cc (right): https://codereview.chromium.org/2411833004/diff/1/sandbox/linux/services/proc_util.cc#newcode54 sandbox/linux/services/proc_util.cc:54: for (struct dirent* e = readdir(dir.get()); e; e = ...
4 years, 2 months ago (2016-10-19 15:50:16 UTC) #9
dcheng
https://codereview.chromium.org/2411833004/diff/1/sandbox/linux/services/proc_util.cc File sandbox/linux/services/proc_util.cc (right): https://codereview.chromium.org/2411833004/diff/1/sandbox/linux/services/proc_util.cc#newcode54 sandbox/linux/services/proc_util.cc:54: for (struct dirent* e = readdir(dir.get()); e; e = ...
4 years, 2 months ago (2016-10-19 22:11:39 UTC) #10
Jorge Lucangeli Obes
On 2016/10/19 22:11:39, dcheng wrote: > https://codereview.chromium.org/2411833004/diff/1/sandbox/linux/services/proc_util.cc > File sandbox/linux/services/proc_util.cc (right): > > https://codereview.chromium.org/2411833004/diff/1/sandbox/linux/services/proc_util.cc#newcode54 > ...
4 years, 2 months ago (2016-10-20 01:49:31 UTC) #11
fwang
Thank you for the review. I uploaded a new patch to add comments in the ...
4 years, 2 months ago (2016-10-20 08:23:30 UTC) #12
fwang
On 2016/10/20 01:49:31, Jorge Lucangeli Obes wrote: > That makes sense. I'd add that explanation ...
4 years, 1 month ago (2016-10-25 07:26:13 UTC) #13
Jorge Lucangeli Obes
lgtm
4 years, 1 month ago (2016-10-25 12:52:46 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2411833004/40001
4 years, 1 month ago (2016-10-25 12:57:50 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/323793)
4 years, 1 month ago (2016-10-25 13:48:33 UTC) #19
fwang
So the NaCl tests are failing because readdir is not implemented: https://cs.chromium.org/chromium/src/native_client/src/nonsfi/linux/directory.c?l=112 I'm not sure ...
4 years, 1 month ago (2016-10-26 09:24:18 UTC) #20
bbudge-google
+mseaborn +mcgrathr for their expert opinions. -dmichael (off chromium)
4 years, 1 month ago (2016-10-26 17:33:00 UTC) #22
Mark Seaborn
On 2016/10/26 09:24:18, fwang wrote: > So the NaCl tests are failing because readdir is ...
4 years, 1 month ago (2016-10-26 17:52:06 UTC) #23
fwang
On 2016/10/26 17:52:06, Mark Seaborn wrote: > A quicker but less elegant fix could be: ...
4 years, 1 month ago (2016-10-26 18:03:16 UTC) #24
fwang
The bots are now green again. PTAL
4 years, 1 month ago (2016-10-28 13:10:48 UTC) #29
fwang
On 2016/10/28 13:10:48, fwang wrote: > The bots are now green again. PTAL @Jorge Lucangeli ...
4 years, 1 month ago (2016-10-31 14:33:30 UTC) #30
Jorge Lucangeli Obes
On 2016/10/31 14:33:30, fwang wrote: > On 2016/10/28 13:10:48, fwang wrote: > > The bots ...
4 years, 1 month ago (2016-10-31 15:58:34 UTC) #31
Jorge Lucangeli Obes
https://codereview.chromium.org/2411833004/diff/60001/sandbox/linux/services/proc_util.cc File sandbox/linux/services/proc_util.cc (right): https://codereview.chromium.org/2411833004/diff/60001/sandbox/linux/services/proc_util.cc#newcode54 sandbox/linux/services/proc_util.cc:54: #if defined(OS_NACL_NONSFI) I would add another comment here (and ...
4 years, 1 month ago (2016-10-31 15:58:47 UTC) #32
fwang
On 2016/10/31 15:58:34, Jorge Lucangeli Obes wrote: > """ > * Verify that native_client/src/nonsfi/linux/directory.c checks ...
4 years, 1 month ago (2016-10-31 18:39:51 UTC) #33
Jorge Lucangeli Obes
On 2016/10/31 18:39:51, fwang wrote: > On 2016/10/31 15:58:34, Jorge Lucangeli Obes wrote: > > ...
4 years, 1 month ago (2016-10-31 19:02:46 UTC) #34
Jorge Lucangeli Obes
On 2016/10/31 18:39:51, fwang wrote: > On 2016/10/31 15:58:34, Jorge Lucangeli Obes wrote: > > ...
4 years, 1 month ago (2016-10-31 19:02:48 UTC) #35
fwang
@Jorge Lucangeli Obes: Thanks for the feedback. I uploaded a new patch that addresses these ...
4 years, 1 month ago (2016-10-31 20:13:02 UTC) #38
Jorge Lucangeli Obes
lgtm
4 years, 1 month ago (2016-10-31 20:14:26 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2411833004/80001
4 years, 1 month ago (2016-10-31 21:06:00 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/171423)
4 years, 1 month ago (2016-10-31 22:12:00 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2411833004/80001
4 years, 1 month ago (2016-10-31 22:15:37 UTC) #47
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 1 month ago (2016-10-31 23:41:08 UTC) #49
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/c2fdc2710b700158ad46111be664eac7ede0fdce Cr-Commit-Position: refs/heads/master@{#428867}
4 years, 1 month ago (2016-10-31 23:43:00 UTC) #51
jbudorick
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/2466773003/ by jbudorick@chromium.org. ...
4 years, 1 month ago (2016-11-01 04:20:11 UTC) #52
jbudorick
On 2016/11/01 04:20:11, jbudorick wrote: > A revert of this CL (patchset #5 id:80001) has ...
4 years, 1 month ago (2016-11-01 19:47:43 UTC) #53
fwang
4 years, 1 month ago (2016-11-07 12:30:40 UTC) #54
Message was sent while issue was closed.
Thanks for the trace. Just for the record, I'm no longer working on this and I'm
working this issue locally by using treat_warnings_as_errors = false

Powered by Google App Engine
This is Rietveld 408576698