]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blobdiff - e2fsck/message.c
e2fsck: remove get_filename_hash() prototype
[thirdparty/e2fsprogs.git] / e2fsck / message.c
index 1c3fcd88bf11559a813d0013ce6f5f873a3638f5..30ce620aa123aecffcc0d73f7febfeaeeb31a5e6 100644 (file)
@@ -48,6 +48,9 @@
  *                     the containing directory.
  *     %r      <blkcount>              interpret blkcount as refcount
  *     %s      <str>                   miscellaneous string
+ *     %t      time (in <num>)
+ *     %T      current time
+ *     %U      quota type (in <num>)
  *     %S      backup superblock
  *     %X      <num> hexadecimal format
  *
@@ -92,9 +95,9 @@
 #include <string.h>
 #include <ctype.h>
 #include <termios.h>
+#include "support/quotaio.h"
 
 #include "e2fsck.h"
-
 #include "problem.h"
 
 #ifdef __GNUC__
@@ -221,7 +224,7 @@ static void print_time(FILE *f, time_t t)
        static int              do_gmt = -1;
 
 #ifdef __dietlibc__
-               /* The diet libc doesn't respect the TZ environemnt variable */
+               /* The diet libc doesn't respect the TZ environment variable */
                if (do_gmt == -1) {
                        time_str = getenv("TZ");
                        if (!time_str)
@@ -500,6 +503,27 @@ static _INLINE_ void expand_percent_expression(FILE *f, ext2_filsys fs,
        case 'T':
                print_time(f, e2fsck_ctx ? e2fsck_ctx->now : time(0));
                break;
+       case 'U':
+               switch (ctx->num) {
+               case USRQUOTA:
+                       m = _("user");
+                       break;
+               case GRPQUOTA:
+                       m = _("group");
+                       break;
+               case PRJQUOTA:
+                       m = _("project");
+                       break;
+               default:
+                       m = _("unknown quota type");
+                       break;
+               }
+               if (*first && islower(m[0]))
+                       fputc(toupper(*m++), f);
+               fputs(m, f);
+               if (ctx->num > PRJQUOTA)
+                       fprintf(f, " %d", (int) ctx->num);
+               break;
        case 'x':
                fprintf(f, "0x%0*x", width, ctx->csum1);
                break;