RESOLVED DUPLICATE of bug 54167 Bug 54190
Fix ignore return warning in OSRandomSource.cpp
https://bugs.webkit.org/show_bug.cgi?id=54190
Summary Fix ignore return warning in OSRandomSource.cpp
Peter Varga
Reported 2011-02-10 03:56:23 PST
I got this warning with gcc-4.4.5: cc1plus: warnings being treated as errors ../../../Source/JavaScriptCore/wtf/OSRandomSource.cpp: In function 'void WTF::randomValuesFromOS(unsigned char*, size_t)': ../../../Source/JavaScriptCore/wtf/OSRandomSource.cpp:53: error: ignoring return value of 'ssize_t read(int, void*, size_t)', declared with attribute warn_unused_result
Attachments
proposed patch (1.49 KB, patch)
2011-02-10 04:10 PST, Peter Varga
ossy: review-
ossy: commit-queue-
proposed patch v2 (1.53 KB, patch)
2011-02-10 04:28 PST, Peter Varga
no flags
Peter Varga
Comment 1 2011-02-10 04:10:06 PST
Created attachment 81948 [details] proposed patch
Csaba Osztrogonác
Comment 2 2011-02-10 04:21:59 PST
Comment on attachment 81948 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=81948&action=review > Source/JavaScriptCore/wtf/OSRandomSource.cpp:54 > if (fd < 0) > CRASH(); // We need /dev/urandom for this API to work... > > - read(fd, buffer, length); > - close(fd); > + if (read(fd, buffer, length)) > + close(fd); read returns 0 at the end of file and -1 on errors. The return value should be length. If an error occures, we should crash instead of using uninitialized buffer. if (read(fd, buffer, length) == length) close(fd); else CRASH();
Peter Varga
Comment 3 2011-02-10 04:28:50 PST
Created attachment 81950 [details] proposed patch v2
WebKit Commit Bot
Comment 4 2011-02-10 04:53:55 PST
Comment on attachment 81950 [details] proposed patch v2 Rejecting attachment 81950 [details] from commit-queue. Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-3', 'apply-..." exit_code: 2 Last 500 characters of output: ts/svn-apply', u'--reviewer', u'Csaba Osztrogon\xe1c',..." exit_code: 1 Parsed 2 diffs from patch file(s). patching file Source/JavaScriptCore/ChangeLog Hunk #1 succeeded at 1 with fuzz 3. patching file Source/JavaScriptCore/wtf/OSRandomSource.cpp Hunk #1 FAILED at 50. 1 out of 1 hunk FAILED -- saving rejects to file Source/JavaScriptCore/wtf/OSRandomSource.cpp.rej Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--reviewer', u'Csaba Osztrogon\xe1c',..." exit_code: 1 Full output: http://queues.webkit.org/results/7886288
Csaba Osztrogonác
Comment 5 2011-02-10 04:56:57 PST
CQ can't apply your patch because of http://trac.webkit.org/changeset/78195 Could you land it manually?
Csaba Osztrogonác
Comment 6 2011-02-10 05:05:42 PST
*** This bug has been marked as a duplicate of bug 54167 ***
Note You need to log in before you can comment on or make changes to this bug.