[MERGED] libosmocore[master]: fix wrong return code

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Mar 15 13:08:13 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: fix wrong return code
......................................................................


fix wrong return code

In case we are a daemon, we do not need to daemonize again.
On the other hand everything is fine and we also do not need
to bail out with an error.

The daemonize template at [1] does the same.

[1] http://www.itp.uzh.ch/~dpotter/howto/daemonize

Change-Id: Ia4dcf7344bd65934faa3d7d46563f6e0532c232e
---
M src/application.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/application.c b/src/application.c
index 8a325c8..4112e75 100644
--- a/src/application.c
+++ b/src/application.c
@@ -124,7 +124,7 @@
 
 	/* Check if parent PID == init, in which case we are already a daemon */
 	if (getppid() == 1)
-		return -EEXIST;
+		return 0;
 
 	/* Fork from the parent process */
 	pid = fork();

-- 
To view, visit https://gerrit.osmocom.org/2046
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4dcf7344bd65934faa3d7d46563f6e0532c232e
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Thorsten Alteholz <osmocom at alteholz.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Thorsten Alteholz <osmocom at alteholz.de>



More information about the gerrit-log mailing list