Bug#338646: Patch file

Brooks R Robinson extremescholar at gmail.com
Wed Nov 16 19:59:35 UTC 2005


Greetings,
	I have isolated what, I think, causes my particular bug.  Following is a patch.

Thanks,

Brooks

<Here starteth the patch>
diff -Naur asterisk-1.0.7.dfsg.1/asterisk.c asterisk-1.0.7.dfsg.1.patched/asterisk.c
--- asterisk-1.0.7.dfsg.1/asterisk.c	2005-11-16 13:36:55.308985128 -0600
+++ asterisk-1.0.7.dfsg.1.patched/asterisk.c	2005-11-16 13:37:10.426686888 -0600
@@ -1785,11 +1785,12 @@
 
 	if (!option_verbose && !option_debug && !option_nofork && !option_console) {
 		daemon(0,0);
+		ast_mainpid = getpid();
 		/* Blindly re-write pid file since we are forking */
 		unlink((char *)ast_config_AST_PID);
 		f = fopen((char *)ast_config_AST_PID, "w");
 		if (f) {
-			fprintf(f, "%d\n", getpid());
+			fprintf(f, "%d\n", ast_mainpid);
 			fclose(f);
 		} else
 			ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno));
<Here endeth the patch>
-------------- next part --------------
diff -Naur asterisk-1.0.7.dfsg.1/asterisk.c asterisk-1.0.7.dfsg.1.patched/asterisk.c
--- asterisk-1.0.7.dfsg.1/asterisk.c	2005-11-16 13:36:55.308985128 -0600
+++ asterisk-1.0.7.dfsg.1.patched/asterisk.c	2005-11-16 13:37:10.426686888 -0600
@@ -1785,11 +1785,12 @@
 
 	if (!option_verbose && !option_debug && !option_nofork && !option_console) {
 		daemon(0,0);
+		ast_mainpid = getpid();
 		/* Blindly re-write pid file since we are forking */
 		unlink((char *)ast_config_AST_PID);
 		f = fopen((char *)ast_config_AST_PID, "w");
 		if (f) {
-			fprintf(f, "%d\n", getpid());
+			fprintf(f, "%d\n", ast_mainpid);
 			fclose(f);
 		} else
 			ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno));


More information about the Pkg-voip-maintainers mailing list