On Tue, Feb 03, 2009 at 07:55:57PM +0100, walter harms wrote: > > >Bernhard Reutner-Fischer schrieb: >> On Sun, Feb 01, 2009 at 08:02:48PM +0100, walter harms wrote:
>>> * http://www.opengroup.org/onlinepubs/007904975/utilities/touch.html >> >> wrong URL. The SUSv4 one for who would be >> http://www.opengroup.org/onlinepubs/9699919799/utilities/who.html >> > >i work after that specs, did they change something ? Well, you definitely did _not_ work after the specs you cite in above URL ;) I didn't look if or what changed, see the docs. >> please remove that $Id >> > >please after this is moved to bb svn. it is my cvs and i need them to keep >track >about the changes. ok >>> /* >>> utmpname() will not fail if the file does not exists >>> */ >>> if (*argv) >>> utmpname(*argv); >> >> perhaps utmpname returning <0 should set EXIT_FAILURE? The big one on my >> box doesn't seem to do that but i would have expected 'who /nope' to fail. >> > > void utmpname(const char *file); Mine looks like: include/utmp.h:extern int utmpname (__const char *__file) __THROW; What libc are you using? >> could be that it's cheaper to set the unconditional stuff (e.g. NAME) once, >> before that block. > >i do not understand. do you suggest something like .. > >pattern=NAME > >if (foo) > pattern|=LINE; yes, exactly (if it's benefical) > > > > >>> if (opt & OPT_m) { >>> name = ttyname(STDIN_FILENO); >>> if (!name || strncmp(name, "/dev/", 5) ) >>> bb_perror_msg_and_die("ttyname()"); >>> name += 5; >>> /* >>> else >>> something strange is going on >>> can this ever happen ? >>> */ >>> >>> } >>> >>> setutent(); >>> >>> if (opt & OPT_H) >>> print_header(pattern); >> >> I'd just test pattern here and don't call it otherwise? > >pattern is used by print_header so what what header infos are needed , is that >the question ? no, you check for pattern == 0 && return, just don't call print_header if pattern is 0 and remove the check from print_header. See? >actualy i did some time ago, it seems i added some spaces >i will rerun indent again and resend thanks. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
