]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
uuidd: use UUIDD_OP_GETPID instead of magic number
authorPetr Uzel <petr.uzel@suse.cz>
Thu, 3 May 2012 19:01:47 +0000 (21:01 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 4 May 2012 13:13:20 +0000 (15:13 +0200)
Make parameters passed to call_daemon() more descriptive:
- use UUIDD_OP_GETPID instead of magic number 0
- call_daemon() takes pointer as a last argument, so pass NULL instead
  of 0

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

index 7c19615b5f0776da5990ea18667249cb8fb4c050..80600f1913f11649d3ceb337c0a77ee01266a185 100644 (file)
@@ -244,7 +244,7 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
                        fprintf(stderr, _("Failed to lock %s: %m\n"), pidfile_path);
                exit(EXIT_FAILURE);
        }
-       ret = call_daemon(socket_path, 0, reply_buf, sizeof(reply_buf), 0, 0);
+       ret = call_daemon(socket_path, UUIDD_OP_GETPID, reply_buf, sizeof(reply_buf), 0, NULL);
        if (ret > 0) {
                if (!quiet)
                        printf(_("uuidd daemon already running at pid %s\n"),
@@ -578,7 +578,7 @@ int main(int argc, char **argv)
        }
 
        if (do_kill) {
-               ret = call_daemon(socket_path, 0, buf, sizeof(buf), 0, 0);
+               ret = call_daemon(socket_path, UUIDD_OP_GETPID, buf, sizeof(buf), 0, NULL);
                if ((ret > 0) && ((do_kill = atoi((char *) buf)) > 0)) {
                        ret = kill(do_kill, SIGTERM);
                        if (ret < 0) {