[SCM] strace branch, master, updated. v4.6-126-g5284557
Dmitry V. Levin
ldv at altlinux.org
Wed Aug 31 20:07:52 UTC 2011
On Wed, Aug 31, 2011 at 10:11:49AM +0000, Denys Vlasenko wrote:
> commit 5284557bfad96f12dd5798539008e1644f1dc094
> Author: Denys Vlasenko <dvlasenk at redhat.com>
> Date: Wed Aug 31 12:07:38 2011 +0200
>
> Optimization: eliminate some usages of strcat()
>
> * defs.h: Declare stpcpy().
> * util.c: Define stpcpy().
> * file.c: Remove static str_append().
> (sprint_open_modes): Use stpcpy() instead of str_append().
> (sprintflags): Use stpcpy() instead of strcat().
> (printpathn): Eliminate usage of strcat().
> (printstr): Eliminate usage of strcat().
This is OK, but
> --- a/defs.h
> +++ b/defs.h
> @@ -680,6 +680,13 @@ extern void tv_sub(struct timeval *, struct timeval *, struct timeval *);
> extern void tv_mul(struct timeval *, struct timeval *, int);
> extern void tv_div(struct timeval *, struct timeval *, int);
>
> +/* Some libc have stpcpy, some don't. Sigh...
> + * Roll our private implementation...
> + */
> +#undef stpcpy
> +#define stpcpy strace_stpcpy
> +extern char *stpcpy(char *dst, const char *src);
> +
I'd rather add stpcpy to AC_CHECK_FUNCS, to use stpcpy() from libc if
the latter provides stpcpy().
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20110901/a7d28a87/attachment.bin>
More information about the Strace-devel
mailing list