diff options
author | Mattias Andrée <m@maandree.se> | 2024-10-14 15:51:39 +0200 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2024-10-14 15:51:39 +0200 |
commit | c3d5fdc6fba10b7ab71bb5437f8fdad4b2038b3d (patch) | |
tree | ad62569e3baac1a2b051cf8f6cab00233a17621c /servers-kernel.c | |
parent | Update e-mail (diff) | |
download | coopgammad-master.tar.gz coopgammad-master.tar.bz2 coopgammad-master.tar.xz |
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'servers-kernel.c')
-rw-r--r-- | servers-kernel.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/servers-kernel.c b/servers-kernel.c index fd60aef..a5e3871 100644 --- a/servers-kernel.c +++ b/servers-kernel.c @@ -3,8 +3,6 @@ #include "state.h" #include "util.h" -#include <libgamma.h> - #include <sys/socket.h> #include <sys/stat.h> #include <sys/un.h> @@ -16,6 +14,8 @@ #include <string.h> #include <unistd.h> +#include <libgamma.h> + /** * Get the pathname of the runtime file @@ -29,6 +29,7 @@ get_pathname(const char *restrict suffix) { const char *restrict rundir = getenv("XDG_RUNTIME_DIR"); const char *restrict username = ""; + const char *const_name; char *name = NULL; char *p; char *restrict rc; @@ -39,8 +40,8 @@ get_pathname(const char *restrict suffix) name = memdup(sitename, strlen(sitename) + 1); if (!name) goto fail; - } else if ((name = libgamma_method_default_site(method))) { - name = memdup(name, strlen(name) + 1); + } else if ((const_name = libgamma_method_default_site(method))) { + name = memdup(const_name, strlen(const_name) + 1); if (!name) goto fail; } @@ -176,7 +177,7 @@ retry: goto bad; if ((size_t)(p - content) != n) goto bad; - sprintf(temp, "%llu\n", (unsigned long long)pid); + sprintf(temp, "%llu\n", (unsigned long long int)pid); if (strcmp(content, temp)) goto bad; free(content); |