search for: do_preformat

Displaying 4 results from an estimated 4 matches for "do_preformat".

2009 May 29
1
[PATCH v2] klibc-utils: add simple ls
...nclude <sys/sysmacros.h> + +#define STAT_ISSET(mode, mask) (((mode) & mask) == mask) + +static size_t max_linksiz = 128; +static int max_nlinks = 1; +static int max_size = 1; +static int max_uid = 1; +static int max_gid = 1; +static int max_min = 1; +static int max_maj = 1; + +static void do_preformat(const struct stat *st) +{ + int bytes; + + if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_nlink)) > max_nlinks) + max_nlinks = bytes; + + if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_uid)) > max_uid) + max_uid = bytes; + + if ((bytes = snprint...
2009 May 28
1
[PATCH] klibc-utils: add minils
...+#include <sys/sysmacros.h> +#include <sys/types.h> + +#define STAT_ISSET(mode, mask) (((mode) & mask) == mask) + +static int max_nlinks = 1; +static int max_size = 1; +static int max_uid = 1; +static int max_gid = 1; +static int max_min = 1; +static int max_maj = 1; + +static void do_preformat(const struct stat *st) { + int bytes; + + if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_nlink)) > max_nlinks) + max_nlinks = bytes; + + if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_uid)) > max_uid) + max_uid = bytes; + + if ((bytes = snprintf...
2023 Jan 13
0
[klibc:master] ls: Handle relative directory names correctly
...d-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/utils/ls.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/usr/utils/ls.c b/usr/utils/ls.c index 9677bc0f..50af4349 100644 --- a/usr/utils/ls.c +++ b/usr/utils/ls.c @@ -50,7 +50,7 @@ static void do_preformat(const struct stat *st) return; } -static void do_stat(const struct stat *st, const char *path) +static void do_stat(const struct stat *st, int dir_fd, const char *path) { char *fmt, *link_name; int rc; @@ -138,7 +138,7 @@ static void do_stat(const struct stat *st, const char *path) pe...
2011 Jul 07
5
[PATCH 0/5] checkpatch cleanups
It seems checkpatch errors krept in, this is a first go. Next run will go into usr/kinit directory. No code changes, just codingstyle fixes (verified with size(3)). maximilian attems (5): [klibc] sleep: have argument on next line [klibc] readklink: remove unneeded braces [klibc] mount: whitespace policy [klibc] ls: fix various checkpatch complaints [klibc] tests: checkpatch fixlets