Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
cf9ced5e
Commit
cf9ced5e
authored
Feb 05, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fixed compile without inotify.
parent
0c27db0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
40 deletions
+25
-40
change.c
server/change.c
+25
-40
No files found.
server/change.c
View file @
cf9ced5e
...
...
@@ -122,25 +122,7 @@ static inline int inotify_remove_watch( int fd, int wd )
return
ret
;
}
#else
static
inline
int
inotify_init
(
void
)
{
errno
=
ENOSYS
;
return
-
1
;
}
static
inline
int
inotify_add_watch
(
int
fd
,
const
char
*
name
,
unsigned
int
mask
)
{
errno
=
ENOSYS
;
return
-
1
;
}
static
inline
int
inotify_remove_watch
(
int
fd
,
int
wd
)
{
errno
=
ENOSYS
;
return
-
1
;
}
#define USE_INOTIFY
#endif
...
...
@@ -348,11 +330,7 @@ static void dir_destroy( struct object *obj )
remove_change
(
dir
);
if
(
dir
->
inotify_fd
)
{
if
(
dir
->
wd
!=
-
1
)
inotify_remove_watch
(
get_unix_fd
(
dir
->
inotify_fd
),
dir
->
wd
);
release_object
(
dir
->
inotify_fd
);
}
if
(
dir
->
event
)
{
...
...
@@ -379,6 +357,8 @@ static int dir_get_info( struct fd *fd )
}
#ifdef USE_INOTIFY
static
int
inotify_get_poll_events
(
struct
fd
*
fd
);
static
void
inotify_poll_event
(
struct
fd
*
fd
,
int
event
);
static
int
inotify_get_info
(
struct
fd
*
fd
);
...
...
@@ -434,12 +414,27 @@ static int inotify_get_info( struct fd *fd )
return
0
;
}
static
void
inotify_adjust_changes
(
struct
dir
*
dir
)
static
inline
struct
fd
*
create_inotify_fd
(
struct
dir
*
dir
)
{
int
unix_fd
;
unix_fd
=
inotify_init
();
if
(
unix_fd
<
0
)
return
NULL
;
return
create_anonymous_fd
(
&
inotify_fd_ops
,
unix_fd
,
&
dir
->
obj
);
}
static
int
inotify_adjust_changes
(
struct
dir
*
dir
)
{
int
filter
=
dir
->
filter
;
unsigned
int
filter
=
dir
->
filter
;
unsigned
int
mask
=
0
;
char
link
[
32
];
if
(
!
dir
->
inotify_fd
)
{
if
(
!
(
dir
->
inotify_fd
=
create_inotify_fd
(
dir
)))
return
0
;
}
if
(
filter
&
FILE_NOTIFY_CHANGE_FILE_NAME
)
mask
|=
(
IN_MOVED_FROM
|
IN_MOVED_TO
|
IN_DELETE
|
IN_CREATE
);
if
(
filter
&
FILE_NOTIFY_CHANGE_DIR_NAME
)
...
...
@@ -461,17 +456,10 @@ static void inotify_adjust_changes( struct dir *dir )
dir
->
wd
=
inotify_add_watch
(
get_unix_fd
(
dir
->
inotify_fd
),
link
,
mask
);
if
(
dir
->
wd
!=
-
1
)
set_fd_events
(
dir
->
inotify_fd
,
POLLIN
);
return
1
;
}
static
struct
fd
*
create_inotify_fd
(
struct
dir
*
dir
)
{
int
unix_fd
;
unix_fd
=
inotify_init
();
if
(
unix_fd
<
0
)
return
NULL
;
return
create_anonymous_fd
(
&
inotify_fd_ops
,
unix_fd
,
&
dir
->
obj
);
}
#endif
/* USE_INOTIFY */
/* enable change notifications for a directory */
DECL_HANDLER
(
read_directory_changes
)
...
...
@@ -512,13 +500,10 @@ DECL_HANDLER(read_directory_changes)
if
(
dir
->
signaled
>
0
)
dir
->
signaled
--
;
if
(
!
dir
->
inotify_fd
)
dir
->
inotify_fd
=
create_inotify_fd
(
dir
);
/* setup the real notification */
if
(
dir
->
inotify_fd
)
inotify_adjust_changes
(
dir
);
else
#ifdef USE_INOTIFY
if
(
!
inotify_adjust_changes
(
dir
))
#endif
dnotify_adjust_changes
(
dir
);
set_error
(
STATUS_PENDING
);
...
...
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