Annotation of /trunk/pulseaudio/patches/pulseaudio-1.1-remove-usage-of-deprecated-udev_get_-_path.patch
Parent Directory | Revision Log
Revision 1826 -
(hide annotations)
(download)
Sat Jun 30 18:42:58 2012 UTC (12 years, 2 months ago) by niro
File size: 2929 byte(s)
Sat Jun 30 18:42:58 2012 UTC (12 years, 2 months ago) by niro
File size: 2929 byte(s)
-added patch to fix ftbfs with newer udev versions
1 | niro | 1826 | From 45607b113a052e4bec93a8707dc4db113c5dd100 Mon Sep 17 00:00:00 2001 |
2 | From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> | ||
3 | Date: Sat, 26 May 2012 02:58:11 +0200 | ||
4 | Subject: [PATCH] Remove usage of deprecated udev_get_*_path | ||
5 | |||
6 | These symbols were removed in libudev.so.1.0.0. Replace them with | ||
7 | hardcoded strings. | ||
8 | |||
9 | Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> | ||
10 | --- | ||
11 | src/modules/module-udev-detect.c | 9 +++------ | ||
12 | src/modules/udev-util.c | 4 ++-- | ||
13 | 2 files changed, 5 insertions(+), 8 deletions(-) | ||
14 | |||
15 | diff --git a/src/modules/module-udev-detect.c b/src/modules/module-udev-detect.c | ||
16 | index 1192194..31416bd 100644 | ||
17 | --- a/src/modules/module-udev-detect.c | ||
18 | +++ b/src/modules/module-udev-detect.c | ||
19 | @@ -123,7 +123,7 @@ static char *card_get_sysattr(const char *card_idx, const char *name) { | ||
20 | goto finish; | ||
21 | } | ||
22 | |||
23 | - t = pa_sprintf_malloc("%s/class/sound/card%s", udev_get_sys_path(udev), card_idx); | ||
24 | + t = pa_sprintf_malloc("/sys/class/sound/card%s", card_idx); | ||
25 | card = udev_device_new_from_syspath(udev, t); | ||
26 | pa_xfree(t); | ||
27 | |||
28 | @@ -282,7 +282,7 @@ static void verify_access(struct userdata *u, struct device *d) { | ||
29 | pa_assert(u); | ||
30 | pa_assert(d); | ||
31 | |||
32 | - cd = pa_sprintf_malloc("%s/snd/controlC%s", udev_get_dev_path(u->udev), path_get_card_id(d->path)); | ||
33 | + cd = pa_sprintf_malloc("/dev/snd/controlC%s", path_get_card_id(d->path)); | ||
34 | accessible = access(cd, R_OK|W_OK) >= 0; | ||
35 | pa_log_debug("%s is accessible: %s", cd, pa_yes_no(accessible)); | ||
36 | |||
37 | @@ -621,7 +621,6 @@ fail: | ||
38 | } | ||
39 | |||
40 | static int setup_inotify(struct userdata *u) { | ||
41 | - char *dev_snd; | ||
42 | int r; | ||
43 | |||
44 | if (u->inotify_fd >= 0) | ||
45 | @@ -632,9 +631,7 @@ static int setup_inotify(struct userdata *u) { | ||
46 | return -1; | ||
47 | } | ||
48 | |||
49 | - dev_snd = pa_sprintf_malloc("%s/snd", udev_get_dev_path(u->udev)); | ||
50 | - r = inotify_add_watch(u->inotify_fd, dev_snd, IN_ATTRIB|IN_CLOSE_WRITE|IN_DELETE_SELF|IN_MOVE_SELF); | ||
51 | - pa_xfree(dev_snd); | ||
52 | + r = inotify_add_watch(u->inotify_fd, "/dev/snd", IN_ATTRIB|IN_CLOSE_WRITE|IN_DELETE_SELF|IN_MOVE_SELF); | ||
53 | |||
54 | if (r < 0) { | ||
55 | int saved_errno = errno; | ||
56 | diff --git a/src/modules/udev-util.c b/src/modules/udev-util.c | ||
57 | index 2f18bc4..b0bb17d 100644 | ||
58 | --- a/src/modules/udev-util.c | ||
59 | +++ b/src/modules/udev-util.c | ||
60 | @@ -180,7 +180,7 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) { | ||
61 | goto finish; | ||
62 | } | ||
63 | |||
64 | - t = pa_sprintf_malloc("%s/class/sound/card%i", udev_get_sys_path(udev), card_idx); | ||
65 | + t = pa_sprintf_malloc("/sys/class/sound/card%i", card_idx); | ||
66 | card = udev_device_new_from_syspath(udev, t); | ||
67 | pa_xfree(t); | ||
68 | |||
69 | @@ -277,7 +277,7 @@ char* pa_udev_get_property(int card_idx, const char *name) { | ||
70 | goto finish; | ||
71 | } | ||
72 | |||
73 | - t = pa_sprintf_malloc("%s/class/sound/card%i", udev_get_sys_path(udev), card_idx); | ||
74 | + t = pa_sprintf_malloc("/sys/class/sound/card%i", card_idx); | ||
75 | card = udev_device_new_from_syspath(udev, t); | ||
76 | pa_xfree(t); | ||
77 | |||
78 | -- | ||
79 | 1.7.10.2 |