aboutsummaryrefslogtreecommitdiffstats
path: root/servers-kernel.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-10-14 15:51:39 +0200
committerMattias Andrée <m@maandree.se>2024-10-14 15:51:39 +0200
commitc3d5fdc6fba10b7ab71bb5437f8fdad4b2038b3d (patch)
treead62569e3baac1a2b051cf8f6cab00233a17621c /servers-kernel.c
parentUpdate e-mail (diff)
downloadcoopgammad-c3d5fdc6fba10b7ab71bb5437f8fdad4b2038b3d.tar.gz
coopgammad-c3d5fdc6fba10b7ab71bb5437f8fdad4b2038b3d.tar.bz2
coopgammad-c3d5fdc6fba10b7ab71bb5437f8fdad4b2038b3d.tar.xz
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--servers-kernel.c11
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);