diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-28 14:00:42 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-28 14:00:42 +0100 |
commit | 4fc510f4cbf54686eb2e95df9f4ff4f41e8ce05c (patch) | |
tree | e1c15a97a2a2983671b925b373dfb17f27c932cb /src | |
parent | doc (diff) | |
download | sat-4fc510f4cbf54686eb2e95df9f4ff4f41e8ce05c.tar.gz sat-4fc510f4cbf54686eb2e95df9f4ff4f41e8ce05c.tar.bz2 sat-4fc510f4cbf54686eb2e95df9f4ff4f41e8ce05c.tar.xz |
reorder actions
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r-- | src/satd.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -175,6 +175,21 @@ main(int argc, char *argv[]) if (!(foreground = !strcmp(argv[1], "-f"))) usage(); + /* Get hook-script pathname. */ + if (!getenv("SAT_HOOK_PATH")) { + int do_not_free = 0; + path = hookpath("XDG_CONFIG_HOME", "/sat/hook"); + t (!path && errno); + path = path ? path : hookpath("HOME", "/.config/sat/hook"); + t (!path && errno); + path = path ? path : hookpath(NULL, "/.config/sat/hook"); + t (!path && errno); + path = path ? path : (do_not_free = 1, "/etc/sat/hook"); + t (setenv("SAT_HOOK_PATH", path, 1)); + if (!do_not_free) + free(path); + } + /* Determinate whether the socket was passed with stdin. */ if (fstat(STDIN_FILENO, &attr)) t (errno != EBADF); @@ -210,21 +225,6 @@ main(int argc, char *argv[]) } } - /* Get hook-script pathname. */ - if (!getenv("SAT_HOOK_PATH")) { - int do_not_free = 0; - path = hookpath("XDG_CONFIG_HOME", "/sat/hook"); - t (!path && errno); - path = path ? path : hookpath("HOME", "/.config/sat/hook"); - t (!path && errno); - path = path ? path : hookpath(NULL, "/.config/sat/hook"); - t (!path && errno); - path = path ? path : (do_not_free = 1, "/etc/sat/hook"); - t (setenv("SAT_HOOK_PATH", path, 1)); - if (!do_not_free) - free(path); - } - /* Listen for incoming conections. */ #if SOMAXCONN < SATD_BACKLOG t (listen(sock, SOMAXCONN)); |