Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
280b9e36
Commit
280b9e36
authored
Oct 15, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inotify: Sanitize watches adding loop
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
d092c5ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
fsnotify.c
fsnotify.c
+4
-3
No files found.
fsnotify.c
View file @
280b9e36
...
@@ -245,7 +245,7 @@ err:
...
@@ -245,7 +245,7 @@ err:
static
int
restore_one_inotify
(
int
inotify_fd
,
struct
fsnotify_mark_info
*
info
)
static
int
restore_one_inotify
(
int
inotify_fd
,
struct
fsnotify_mark_info
*
info
)
{
{
InotifyWdEntry
*
iwe
=
info
->
iwe
;
InotifyWdEntry
*
iwe
=
info
->
iwe
;
int
ret
=
-
1
,
wd
,
target
=
-
1
;
int
ret
=
-
1
,
target
=
-
1
;
char
buf
[
32
],
*
path
;
char
buf
[
32
],
*
path
;
path
=
get_mark_path
(
"inotify"
,
info
->
remap
,
iwe
->
f_handle
,
path
=
get_mark_path
(
"inotify"
,
info
->
remap
,
iwe
->
f_handle
,
...
@@ -259,8 +259,9 @@ static int restore_one_inotify(int inotify_fd, struct fsnotify_mark_info *info)
...
@@ -259,8 +259,9 @@ static int restore_one_inotify(int inotify_fd, struct fsnotify_mark_info *info)
* this is suboptimal, but the kernel doesn't
* this is suboptimal, but the kernel doesn't
* provide and API for this yet :(
* provide and API for this yet :(
*/
*/
wd
=
1
;
while
(
1
)
{
while
(
wd
>=
0
)
{
int
wd
;
wd
=
inotify_add_watch
(
inotify_fd
,
path
,
iwe
->
mask
);
wd
=
inotify_add_watch
(
inotify_fd
,
path
,
iwe
->
mask
);
if
(
wd
<
0
)
{
if
(
wd
<
0
)
{
pr_perror
(
"Can't add watch for %d with %d"
,
inotify_fd
,
iwe
->
wd
);
pr_perror
(
"Can't add watch for %d with %d"
,
inotify_fd
,
iwe
->
wd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment