aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-10 02:21:00 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-10 02:21:00 +0100
commit7179f51176e1f3af53694e09d7ea2ca602403cf1 (patch)
treedb24424529090c7ac819e2ec9724c855dbb2d53e /src/mds.c
parenttypo (diff)
downloadmds-7179f51176e1f3af53694e09d7ea2ca602403cf1.tar.gz
mds-7179f51176e1f3af53694e09d7ea2ca602403cf1.tar.bz2
mds-7179f51176e1f3af53694e09d7ea2ca602403cf1.tar.xz
no more direct allocations, always use macros, unless using alloca
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mds.c b/src/mds.c
index 29b1d94..88b4b96 100644
--- a/src/mds.c
+++ b/src/mds.c
@@ -324,10 +324,10 @@ int spawn_and_respawn_server(int fd)
pid_t pid;
int status;
- child_args[0] = strdup(master_server);
+ fail_if (xstrdup(child_args[0], master_server));
for (i = 1; i < argc; i++)
child_args[i] = argv[i];
- child_args[argc + 0] = strdup("--initial-spawn");
+ fail_if (xstrdup(child_args[argc + 0], "--initial-spawn"));
xsnprintf(fdstr, "--socket-fd=%i", fd);
child_args[argc + 1] = fdstr;
child_args[argc + 2] = NULL;
@@ -401,8 +401,7 @@ int spawn_and_respawn_server(int fd)
{
first_spawn = 0;
free(child_args[argc + 0]);
- child_args[argc + 0] = strdup("--respawn");
- fail_if (child_args[argc + 0] == NULL);
+ fail_if (xstrdup(child_args[argc + 0], "--respawn"));
}
goto respawn;