Whamcloud - gitweb
e2fsck: wait fix thread finish before checking
[tools/e2fsprogs.git] / misc / uuidd.c
index 89bff72..4db3fa9 100644 (file)
@@ -11,6 +11,7 @@
 
 #define _GNU_SOURCE /* for setres[ug]id() */
 
+#include "config.h"
 #include <stdio.h>
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
@@ -34,7 +35,8 @@ extern int optind;
 #endif
 #include "uuid/uuid.h"
 #include "uuid/uuidd.h"
-#include "nls-enable.h"
+#include "support/nls-enable.h"
+#include "ext2fs/ext2fs.h"
 
 #ifdef __GNUC__
 #define CODE_ATTR(x) __attribute__(x)
@@ -235,7 +237,7 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
        uuid_t                  uu;
        mode_t                  save_umask;
        char                    reply_buf[1024], *cp;
-       char                    op, str[37];
+       char                    op, str[UUID_STR_SIZE];
        int                     i, s, ns, len, num;
        int                     fd_pidfile, ret;
 
@@ -395,8 +397,11 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
                        uuid__generate_time(uu, &num);
                        if (debug) {
                                uuid_unparse(uu, str);
-                               printf(_("Generated time UUID %s and %d "
-                                        "following\n"), str, num);
+                               printf(P_("Generated time UUID %s and "
+                                         "subsequent UUID\n",
+                                         "Generated time UUID %s and %d "
+                                         "subsequent UUIDs\n", num),
+                                      str, num);
                        }
                        memcpy(reply_buf, uu, sizeof(uu));
                        reply_len = sizeof(uu);
@@ -472,6 +477,7 @@ int main(int argc, char **argv)
                                fprintf(stderr, _("Bad number: %s\n"), optarg);
                                exit(1);
                        }
+                       break;
                case 'p':
                        pidfile_path = optarg;
                        drop_privs = 1;
@@ -535,9 +541,11 @@ int main(int argc, char **argv)
 
                        uuid_unparse((unsigned char *) buf, str);
 
-                       printf(_("%s and subsequent %d UUID's\n"), str, num);
+                       printf(P_("%s and subsequent UUID\n",
+                                 "%s and subsequent %d UUIDs\n", num),
+                              str, num);
                } else {
-                       printf(_("List of UUID's:\n"));
+                       printf("%s", _("List of UUID's:\n"));
                        cp = buf + 4;
                        if (ret != (int) (sizeof(num) + num*sizeof(uu)))
                                goto unexpected_size;