diff options
Diffstat (limited to 'util-linux/mdev.c')
-rw-r--r-- | util-linux/mdev.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index 4b4eeafba..63b55536a 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Licensed under GPLv2, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2, see file LICENSE in this source tree. |
9 | */ | 9 | */ |
10 | //config:config MDEV | 10 | //config:config MDEV |
11 | //config: bool "mdev (16 kb)" | 11 | //config: bool "mdev (17 kb)" |
12 | //config: default y | 12 | //config: default y |
13 | //config: select PLATFORM_LINUX | 13 | //config: select PLATFORM_LINUX |
14 | //config: help | 14 | //config: help |
@@ -808,6 +808,16 @@ static void make_device(char *device_name, char *path, int operation) | |||
808 | } /* for (;;) */ | 808 | } /* for (;;) */ |
809 | } | 809 | } |
810 | 810 | ||
811 | static ssize_t readlink2(char *buf, size_t bufsize) | ||
812 | { | ||
813 | // Grr... gcc 8.1.1: | ||
814 | // "passing argument 2 to restrict-qualified parameter aliases with argument 1" | ||
815 | // dance around that... | ||
816 | char *obuf FIX_ALIASING; | ||
817 | obuf = buf; | ||
818 | return readlink(buf, obuf, bufsize); | ||
819 | } | ||
820 | |||
811 | /* File callback for /sys/ traversal. | 821 | /* File callback for /sys/ traversal. |
812 | * We act only on "/sys/.../dev" (pseudo)file | 822 | * We act only on "/sys/.../dev" (pseudo)file |
813 | */ | 823 | */ |
@@ -831,7 +841,7 @@ static int FAST_FUNC fileAction(const char *fileName, | |||
831 | /* Read ".../subsystem" symlink in the same directory where ".../dev" is */ | 841 | /* Read ".../subsystem" symlink in the same directory where ".../dev" is */ |
832 | strcpy(subsys, path); | 842 | strcpy(subsys, path); |
833 | strcpy(subsys + len, "/subsystem"); | 843 | strcpy(subsys + len, "/subsystem"); |
834 | res = readlink(subsys, subsys, sizeof(subsys)-1); | 844 | res = readlink2(subsys, sizeof(subsys)-1); |
835 | if (res > 0) { | 845 | if (res > 0) { |
836 | subsys[res] = '\0'; | 846 | subsys[res] = '\0'; |
837 | free(G.subsystem); | 847 | free(G.subsystem); |