X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fdaemonize.c;h=16af5a3f78ccec5da76033a48a7d0a04bd0c38f2;hb=48a4000561343808724f7cb5fa8c131877489ccd;hp=b12194ee9480c9aab2933258c987a9adff126100;hpb=0452bf084c6d8416b88c2bb941e99eb4eec453b8;p=lttng-tools.git diff --git a/src/common/daemonize.c b/src/common/daemonize.c index b12194ee9..16af5a3f7 100644 --- a/src/common/daemonize.c +++ b/src/common/daemonize.c @@ -1,19 +1,9 @@ /* - * Copyright (C) 2013 - David Goulet - * Copyright (C) 2014 - Mathieu Desnoyers + * Copyright (C) 2013 David Goulet + * Copyright (C) 2014 Mathieu Desnoyers * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License, version 2 only, as - * published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE @@ -25,14 +15,12 @@ #include -#include -#include +#include +#include -LTTNG_HIDDEN int lttng_daemonize(pid_t *child_ppid, int *completion_flag, int close_fds) { - int ret; pid_t pid; /* Get parent pid of this process. */ @@ -45,6 +33,7 @@ int lttng_daemonize(pid_t *child_ppid, int *completion_flag, } else if (pid == 0) { int fd; pid_t sid; + int ret; /* Child */ @@ -118,7 +107,7 @@ int lttng_daemonize(pid_t *child_ppid, int *completion_flag, /* * From this point on, the parent can exit and the child - * is now an operationnal session daemon ready to serve + * is now an operational session daemon ready to serve * clients and applications. */ exit(EXIT_SUCCESS);