Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
64f7e765
Commit
64f7e765
authored
Oct 17, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udev: handle "change" action properly, fix disc ejection/insertion
parent
83785c78
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
modules/services_discovery/udev.c
modules/services_discovery/udev.c
+8
-14
No files found.
modules/services_discovery/udev.c
View file @
64f7e765
...
...
@@ -172,15 +172,6 @@ static void RemoveDevice (services_discovery_t *sd, struct udev_device *dev)
DestroyDevice
(
d
);
}
static
void
HandleDevice
(
services_discovery_t
*
sd
,
struct
udev_device
*
dev
,
bool
add
)
{
if
(
!
add
)
RemoveDevice
(
sd
,
dev
);
else
AddDevice
(
sd
,
dev
);
}
static
void
*
Run
(
void
*
);
/**
...
...
@@ -230,7 +221,7 @@ static int Open (vlc_object_t *obj, const struct subsys *subsys)
{
const
char
*
path
=
udev_list_entry_get_name
(
deventry
);
struct
udev_device
*
dev
=
udev_device_new_from_syspath
(
udev
,
path
);
HandleDevice
(
sd
,
dev
,
true
);
AddDevice
(
sd
,
dev
);
udev_device_unref
(
dev
);
}
udev_enumerate_unref
(
devenum
);
...
...
@@ -293,13 +284,16 @@ static void *Run (void *data)
if
(
dev
==
NULL
)
continue
;
/* FIXME: handle change, offline, online */
const
char
*
action
=
udev_device_get_action
(
dev
);
if
(
!
strcmp
(
action
,
"add"
))
HandleDevice
(
sd
,
dev
,
true
);
AddDevice
(
sd
,
dev
);
else
if
(
!
strcmp
(
action
,
"remove"
))
HandleDevice
(
sd
,
dev
,
false
);
RemoveDevice
(
sd
,
dev
);
else
if
(
!
strcmp
(
action
,
"change"
))
{
RemoveDevice
(
sd
,
dev
);
AddDevice
(
sd
,
dev
);
}
udev_device_unref
(
dev
);
}
return
NULL
;
...
...
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