diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-04-26 13:15:39 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-04-26 13:15:39 +0000 |
commit | 7cc7c0f7e76824d27ab2bde070620d84f42a89d7 (patch) | |
tree | 3ef8eabaed7111feb6572dc76aa1ca7bd368acd5 /sysdeps/unix/sysv/linux | |
parent | e1fff0e7bf36e21e32bc9f088dda7bf1b037e224 (diff) | |
download | glibc-7cc7c0f7e76824d27ab2bde070620d84f42a89d7.tar.gz glibc-7cc7c0f7e76824d27ab2bde070620d84f42a89d7.tar.xz glibc-7cc7c0f7e76824d27ab2bde070620d84f42a89d7.zip |
Some more optimizations.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c b/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c index 699c7eb767..affe90d686 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c @@ -102,18 +102,19 @@ __get_clockfreq_via_proc_openprom (void) while (len > 0) { - char node_name[strlen ("/proc/openprom/") - + _D_ALLOC_NAMLEN (this_dirp) - + strlen ("/clock-frequency")]; + char node[strlen ("/proc/openprom/") + + _D_ALLOC_NAMLEN (this_dirp) + + strlen ("/clock-frequency")]; + char *prop; int fd; /* Note that strlen("/clock-frequency") > strlen("/device_type") */ - stpcpy (stpcpy (stpcpy (node_name, "/proc/openprom/"), - this_dirp->d_name), - "/device_type"); - fd = open (node_name, O_RDONLY); + __stpcpy (prop = __stpcpy (__stpcpy (node, "/proc/openprom/"), + this_dirp->d_name), + "/device_type"); + fd = open (node, O_RDONLY); if (fd != -1) { char type_string[128]; @@ -124,10 +125,8 @@ __get_clockfreq_via_proc_openprom (void) { int clkfreq_fd; - stpcpy (stpcpy (stpcpy (node_name, "/proc/openprom/"), - this_dirp->d_name), - "/clock-frequency"); - clkfreq_fd = open (node_name, O_RDONLY); + __stpcpy (prop, "/clock-frequency"); + clkfreq_fd = open (node, O_RDONLY); if (fd != -1) { if (read (clkfreq_fd, type_string, |