Message ID | 574ef0eb7e941dcc6c9dba3540f4aa1c213472bc.1374182572.git.yann.morin.1998@free.fr |
---|---|
State | Superseded |
Headers | show |
Dear Yann E. MORIN, I like the feature, but it would be nice if the coding was more consistent with the rest of the code, see below: On Thu, 18 Jul 2013 23:24:15 +0200, Yann E. MORIN wrote: > + if( getenv("BR_DEBUG_WRAPPER") ) { No space after ( and before ). > + fprintf( stderr, "path='%s'\n", path ); Dirro. > + int i; Variable declaration in the middle of the code. I know it's C99 ok, but I'd prefer not to have that (just like the kernel). > + for( i=0; args[i]; i++ ) { for (i = 0; args[i]; i++) > + fprintf(stderr, "argv[%d]='%s'\n", i, args[i] ); Ditto space before ). Thomas
Thomas, All, On 2013-07-18 23:32 +0200, Thomas Petazzoni spake thusly: > I like the feature, but it would be nice if the coding was more > consistent with the rest of the code, see below: Sure! :-) It initially was a quick'n'dirty hack, and I eventually thought it might be useful upstream too. I'll re-read my code better next time... :-/ > On Thu, 18 Jul 2013 23:24:15 +0200, Yann E. MORIN wrote: > > + if( getenv("BR_DEBUG_WRAPPER") ) { > No space after ( and before ). Ack. > > + fprintf( stderr, "path='%s'\n", path ); > Dirro. Ditto? Ditto! ;-) > > + int i; > Variable declaration in the middle of the code. I know it's C99 ok, but > I'd prefer not to have that (just like the kernel). Doh. Right. gcc also whines about this (which was my original code): for( int i=0; args[i]; i++ ) { > > + for( i=0; args[i]; i++ ) { > for (i = 0; args[i]; i++) Ack. > > + fprintf(stderr, "argv[%d]='%s'\n", i, args[i] ); > Ditto space before ). Atta! I'll fix and respin. Thanks! :-) Regsards, Yann E. MORIN.
diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c index 460f255..8e56414 100644 --- a/toolchain/toolchain-external/ext-toolchain-wrapper.c +++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c @@ -136,6 +136,14 @@ int main(int argc, char **argv) /* finish with NULL termination */ *cur = NULL; + if( getenv("BR_DEBUG_WRAPPER") ) { + fprintf( stderr, "path='%s'\n", path ); + int i; + for( i=0; args[i]; i++ ) { + fprintf(stderr, "argv[%d]='%s'\n", i, args[i] ); + } + } + if (execv(path, args)) perror(path);