Merge lp:~jamesodhunt/libnih/nih_io_select_fds-check-limits into lp:libnih

Proposed by James Hunt
Status: Merged
Approved by: Scott James Remnant
Approved revision: 1050
Merged at revision: 1052
Proposed branch: lp:~jamesodhunt/libnih/nih_io_select_fds-check-limits
Merge into: lp:libnih
Diff against target: 34 lines (+9/-0)
2 files modified
ChangeLog (+5/-0)
nih/io.c (+4/-0)
To merge this branch: bzr merge lp:~jamesodhunt/libnih/nih_io_select_fds-check-limits
Reviewer Review Type Date Requested Status
Scott James Remnant Approve
Review via email: mp+73080@code.launchpad.net

Description of the change

  * nih/io.c (nih_io_select_fds): Ensure number of fds being managed
    is within limits.

To post a comment you must log in.
Revision history for this message
Scott James Remnant (scott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2011-06-20 18:47:02 +0000
+++ ChangeLog 2011-08-26 16:39:33 +0000
@@ -1,3 +1,8 @@
12011-08-26 James Hunt <james.hunt@ubuntu.com>
2
3 * nih/io.c (nih_io_select_fds): Ensure number of fds being managed
4 is within limits.
5
12011-06-20 James Hunt <james.hunt@ubuntu.com>62011-06-20 James Hunt <james.hunt@ubuntu.com>
27
3 * nih/watch.c (nih_watch_handle): Handle non-directory watches;8 * nih/watch.c (nih_watch_handle): Handle non-directory watches;
49
=== modified file 'nih/io.c'
--- nih/io.c 2009-08-03 23:29:41 +0000
+++ nih/io.c 2011-08-26 16:39:33 +0000
@@ -165,6 +165,7 @@
165 nih_assert (readfds != NULL);165 nih_assert (readfds != NULL);
166 nih_assert (writefds != NULL);166 nih_assert (writefds != NULL);
167 nih_assert (exceptfds != NULL);167 nih_assert (exceptfds != NULL);
168 nih_assert (*nfds <= FD_SETSIZE);
168169
169 nih_io_init ();170 nih_io_init ();
170171
@@ -186,6 +187,9 @@
186 *nfds = nih_max (*nfds, watch->fd + 1);187 *nfds = nih_max (*nfds, watch->fd + 1);
187 }188 }
188 }189 }
190
191 /* Re-check in case we exceeded the limit in the loop */
192 nih_assert (*nfds <= FD_SETSIZE);
189}193}
190194
191/**195/**

Subscribers

People subscribed via source and target branches