]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
uuidd: correctly report number of generated subsequent UUIDs
authorPetr Uzel <petr.uzel@suse.cz>
Thu, 3 Feb 2011 14:04:59 +0000 (15:04 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Feb 2011 14:22:07 +0000 (15:22 +0100)
Before this change, "uuidd -t -n 1" reported
"6fd0672e-2f9b-11e0-b9c8-000feae00cb0 and subsequent 1 UUIDs".
That is two subsequent UUIDs, which is not correct.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
misc-utils/uuidd.c

index 97caa330010c45b54b5650a4c75583490141e04e..145e6d0efb504a45ec89620c8f4f49f96bb822d7 100644 (file)
@@ -369,7 +369,7 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
                        if (debug) {
                                uuid_unparse(uu, str);
                                printf(_("Generated time UUID %s and %d "
-                                        "following\n"), str, num);
+                                        "following\n"), str, num - 1);
                        }
                        memcpy(reply_buf, uu, sizeof(uu));
                        reply_len = sizeof(uu);
@@ -505,7 +505,7 @@ int main(int argc, char **argv)
 
                        uuid_unparse((unsigned char *) buf, str);
 
-                       printf(_("%s and subsequent %d UUIDs\n"), str, num);
+                       printf(_("%s and subsequent %d UUIDs\n"), str, num - 1);
                } else {
                        printf(_("List of UUIDs:\n"));
                        cp = buf + 4;