aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-server/mds-server.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-10-05 23:23:17 +0200
committerMattias Andrée <m@maandree.se>2024-10-05 23:23:17 +0200
commit98a8ac8498974e499fc129878ab05b9a7bf8ba30 (patch)
tree2914967687516632a93da9af59818f22d3120861 /src/mds-server/mds-server.c
parentUpdate e-mail (diff)
downloadmds-98a8ac8498974e499fc129878ab05b9a7bf8ba30.tar.gz
mds-98a8ac8498974e499fc129878ab05b9a7bf8ba30.tar.bz2
mds-98a8ac8498974e499fc129878ab05b9a7bf8ba30.tar.xz
misc + update e-mailHEADmaster
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'src/mds-server/mds-server.c')
-rw-r--r--src/mds-server/mds-server.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mds-server/mds-server.c b/src/mds-server/mds-server.c
index 58908a4..6ee2e81 100644
--- a/src/mds-server/mds-server.c
+++ b/src/mds-server/mds-server.c
@@ -1,6 +1,6 @@
/**
* mds — A micro-display server
- * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (maandree@kth.se)
+ * Copyright © 2014, 2015, 2016, 2017 Mattias Andrée (m@maandree.se)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -98,14 +98,14 @@ preinitialise_server(void)
/* Parse command line arguments. */
for (i = 1; i < argc; i++) {
arg = argv[i];
- if (startswith(arg, "--socket-fd=")) { /* Socket file descriptor. */
+ if (strstarts(arg, "--socket-fd=")) { /* Socket file descriptor. */
exit_if (socket_fd != -1,
eprintf("duplicate declaration of %s.", "--socket-fd"););
exit_if (strict_atoi(arg += strlen("--socket-fd="), &socket_fd, 0, INT_MAX) < 0,
eprintf("invalid value for %s: %s.", "--socket-fd", arg););
- } else if (startswith(arg, "--alarm=")) { /* Schedule an alarm signal for forced abort. */
- alarm((unsigned)min(atou(arg + strlen("--alarm=")), 60)); /* At most 1 minute. */
- } else if (!strequals(arg, "--initial-spawn") && !strequals(arg, "--respawn")) {
+ } else if (strstarts(arg, "--alarm=")) { /* Schedule an alarm signal for forced abort. */
+ alarm((unsigned)MIN(atou(arg + strlen("--alarm=")), 60)); /* At most 1 minute. */
+ } else if (!streq(arg, "--initial-spawn") && !streq(arg, "--respawn")) {
/* Not recognised, it is probably for another server. */
unparsed_args[unparsed_args_ptr++] = arg;
}
@@ -523,11 +523,11 @@ run_initrc(char **args)
(xsnprintf(pathname, FORMAT, __VA_ARGS__), execv(args[0], args))
/* Test $XDG_CONFIG_HOME. */
- if ((env = getenv_nonempty("XDG_CONFIG_HOME")))
+ if ((env = getenv_ne("XDG_CONFIG_HOME")))
__exec("%s/%s", env, INITRC_FILE);
/* Test $HOME. */
- if ((env = getenv_nonempty("HOME"))) {
+ if ((env = getenv_ne("HOME"))) {
__exec("%s/.config/%s", env, INITRC_FILE);
__exec("%s/.%s", env, INITRC_FILE);
}
@@ -543,7 +543,7 @@ run_initrc(char **args)
}
/* Test $XDG_CONFIG_DIRS. */
- if ((env = getenv_nonempty("XDG_CONFIG_DIRS"))) {
+ if ((env = getenv_ne("XDG_CONFIG_DIRS"))) {
for (begin = env;;) {
end = strchrnul(begin, ':');
len = (int)(end - begin);