[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getzenv() to use (unix) environment ZCONFIG
Matti,
do you think the following change makes any sense?
(will also need to "export ZCONFIG" in "zmailer" script)
Index: libc/getzenv.c
===================================================================
RCS file: /cvsroot/zmailer/libc/getzenv.c,v
retrieving revision 1.5
diff -u -r1.5 getzenv.c
--- libc/getzenv.c 2001/01/15 15:12:04 1.5
+++ libc/getzenv.c 2002/07/11 12:29:01
@@ -28,12 +28,13 @@
static int zenvlen = 0;
int
-readzenv(file)
- const char *file;
+readzenv(void)
{
+ char *file;
int fd;
struct stat stbuf;
+ if (!(file=getenv("ZCONFIG"))) file=ZMAILER_ENV_FILE;
fd = open(file, 0);
if (fd < 0) {
fprintf(stderr, "%s: open: %s: %s\n",
@@ -86,7 +87,7 @@
len = zenvlen;
if (len <= 0) {
- if (!readzenv(ZMAILER_ENV_FILE))
+ if (!readzenv())
return NULL;
len = zenvlen;
if (len <= 0)
Index: include/libc.h
===================================================================
RCS file: /cvsroot/zmailer/include/libc.h,v
retrieving revision 1.11
diff -u -r1.11 libc.h
--- include/libc.h 2002/02/11 15:12:10 1.11
+++ include/libc.h 2002/07/11 12:29:01
@@ -24,7 +24,7 @@
extern int getdtablesize __((void));
/* getzenv.c */
-extern int readzenv __((const char *file));
+extern int readzenv __((void));
extern const char *getzenv __((const char *variable));
/* mail.c */
Index: include/mail.h.in
===================================================================
RCS file: /cvsroot/zmailer/include/mail.h.in,v
retrieving revision 1.11
diff -u -r1.11 mail.h.in
--- include/mail.h.in 2001/07/29 18:21:39 1.11
+++ include/mail.h.in 2002/07/11 12:29:01
@@ -87,7 +87,7 @@
/* These following are declared in order they are in prespective files */
/* getzenv.c */
-extern int readzenv __((const char *file));
+extern int readzenv __((void));
extern const char *getzenv __((const char *variable));
/* mail.c */
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi