[packages/jggtrans] - fix issues with connecting to GG servers when daemonized, thx jajcus

hawk hawk at pld-linux.org
Wed Jul 24 17:52:23 CEST 2013


commit e481dc25bcc284b0d60f9bfec2bd08db9ac933c9
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Wed Jul 24 16:03:59 2013 +0000

    - fix issues with connecting to GG servers when daemonized, thx jajcus

 jggtrans-daemonize.patch | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
---
diff --git a/jggtrans-daemonize.patch b/jggtrans-daemonize.patch
new file mode 100644
index 0000000..33077fc
--- /dev/null
+++ b/jggtrans-daemonize.patch
@@ -0,0 +1,38 @@
+diff -ur jggtrans-2.2.4.orig/src/main.c jggtrans-2.2.4.fix/src/main.c
+--- jggtrans-2.2.4.orig/src/main.c	2013-07-24 13:07:26.000000000 +0000
++++ jggtrans-2.2.4.fix/src/main.c	2013-07-24 15:25:29.822178828 +0000
+@@ -327,7 +327,7 @@
+ 			fclose(pidfile);
+ 		}
+ 		debug(L_("Daemon born, pid %i."),pid);
+-		exit(0);
++		_exit(0);
+ 	}
+ 
+ 	for (fd=0; fd < OPEN_MAX; fd++)
+@@ -566,6 +566,12 @@
+ 	}
+ 	else if (uid==0 && !restarting) g_error("%s", L_("Refusing to run with uid=0"));
+ 
++	if (!fg && !restarting) daemonize(pidfile);
++	else if (pidfile!=NULL){
++		fprintf(pidfile,"%i",getpid());
++		fclose(pidfile);
++	}
++
+ 	main_loop=g_main_new(0);
+ 
+ 	if (jabber_init()) return 1;
+@@ -575,12 +581,6 @@
+ 	if (requests_init()) return 1;
+ 	if (acl_init()) return 1;
+ 
+-	if (!fg && !restarting) daemonize(pidfile);
+-	else if (pidfile!=NULL){
+-		fprintf(pidfile,"%i",getpid());
+-		fclose(pidfile);
+-	}
+-
+ 	if (log_filename){
+ 		log_file=fopen(log_filename,"a");
+ 		if (!log_file) g_critical(L_("Couldn't open log file '%s': %s"),
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/jggtrans.git/commitdiff/b850a178b1e78986530927028efc5b6061e766af



More information about the pld-cvs-commit mailing list