X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fstat.c;h=9963650e5f6c0d022bbcc86329ed611f1e9419f1;hp=4ef6bbe34c89fb65274c96c3670de70a5ce7ef14;hb=37ab828e8dc91225c9ed6daf221552266cf524ba;hpb=090c677210ee2946d99c71412e4ff762bb300f4f diff --git a/lustre/tests/stat.c b/lustre/tests/stat.c index 4ef6bbe..9963650 100644 --- a/lustre/tests/stat.c +++ b/lustre/tests/stat.c @@ -85,6 +85,7 @@ void print_human_fstype(struct statfs *statfsbuf) break; case S_MAGIC_MINIX: type = strdup("minix"); + break; case S_MAGIC_MINIX_30: type = strdup("minix (30 char.)"); break; @@ -145,6 +146,9 @@ void print_human_fstype(struct statfs *statfsbuf) case S_MAGIC_ROMFS: type = strdup("romfs"); break; + case S_MAGIC_LUSTRE: + type = strdup("lustre"); + break; #elif __GNU__ case FSTYPE_UFS: type = strdup("ufs"); @@ -290,12 +294,21 @@ void print_human_access(struct stat *statbuf) printf (access); } +/* trick gcc into being unable to recognize the %c format so it doesn't + * issue its inane warning about %c and two-digit year representations. */ +static size_t strftime_wrapper(char *s, size_t max, const char *fmt, + struct tm *tm) { + return strftime(s, max, fmt, tm); +} + void print_human_time(time_t *t) { char str[40]; - - if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str); - else printf("Cannot calculate human readable time, sorry"); + + if (strftime_wrapper(str, 40, "%c", localtime(t)) > 0) + printf(str); + else + printf("Cannot calculate human readable time, sorry"); } /* print statfs info */ @@ -307,7 +320,7 @@ void print_statfs(char *pformat, char m, char *filename, void *data, SECURITY_ID int rv; unsigned int sbuflen = sizeof(sbuf); #endif - + switch(m) { case 'n': strcat(pformat, "s");