[PATCH] time options for ps

Denys Vlasenko vda.linux at googlemail.com
Sat Jan 5 00:11:19 UTC 2008


On Friday 04 January 2008 14:58, Detlef Vollmann wrote:
> Hello,
> 
> the attached patch adds 'time' and 'etime' for ps.
> It adds more than 2k (but only for CONFIG_DESKTOP) because of
> the expensive computation of HZ.
> If we omit support for pre-2.4 Linux, the space addition would go
> way done.

sizeof is wrong here:

+static inline void file_to_buf(char const *filename, char *buf)
+{
+       if (open_read_close(filename, buf, sizeof(buf)) < 0) {
+               bb_error_msg_and_die(BAD_OPEN_MESSAGE);
+       }
+}

I think some serious code shrink is in order too.
--
vda



More information about the busybox mailing list