changeset 1572:8c0237c8c186

Export the FIFO pipe name as an environment variable (Lukas Kuklinek)
author Mikael Berthe <mikael@lilotux.net>
date Sat, 11 Apr 2009 12:30:51 +0200
parents 481b60da99c9
children ece4f26bf9ff
files mcabber/src/fifo.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/fifo.c	Sat Apr 11 12:20:12 2009 +0200
+++ b/mcabber/src/fifo.c	Sat Apr 11 12:30:51 2009 +0200
@@ -39,6 +39,7 @@
 static FILE *sfd;
 static char *fifo_name;
 
+static const char *FIFO_ENV_NAME = "MCABBER_FIFO";
 
 //  fifo_init(fifo_path)
 // Create and open the FIFO file.
@@ -93,6 +94,8 @@
   if (!fd)
     return -1;
 
+  setenv(FIFO_ENV_NAME, fifo_name, 1);
+
   sfd = fdopen(fd, "r");
   if (fifo_path)
     scr_LogPrint(LPRINT_LOGNORM, "FIFO initialized (%s)", fifo_name);
@@ -103,6 +106,7 @@
 // Close the current FIFO pipe and delete it.
 void fifo_deinit(void)
 {
+  unsetenv(FIFO_ENV_NAME);
   if (sfd) {
     fclose(sfd);
     sfd = NULL;