* libamu/xutil.c (switch_to_logfile): don't try to print logfile
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 4 Apr 2003 15:51:55 +0000 (15:51 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 4 Apr 2003 15:51:55 +0000 (15:51 +0000)
if it is null (strlen core dump on solaris).  Bug report from John
P. Rouillard <rouilj@ieee.org>.

ChangeLog
libamu/xutil.c

index 002f9b779fdceadc4934314a46f282199338636e..b8fce6befe6947c13c4ea8fcdf6f332689221174 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-04  Erez Zadok  <ezk@agora.fsl.cs.sunysb.edu>
+
+       * libamu/xutil.c (switch_to_logfile): don't try to print logfile
+       if it is null (strlen core dump on solaris).  Bug report from John
+       P. Rouillard <rouilj@ieee.org>.
+
 2003-03-31  Erez Zadok  <ezk@agora.fsl.cs.sunysb.edu>
 
        * fsinfo/fsinfo.8: typo co-ordinate -> coordinate.  Typo report
index 92084ef25954fcbe8f707c7616604fbaf53168a0..ad1cd996721d104fcbcc897570978939b9b071f9 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: xutil.c,v 1.29 2002/12/28 22:28:57 ib42 Exp $
+ * $Id: xutil.c,v 1.30 2003/04/04 15:51:56 ezk Exp $
  *
  */
 
@@ -813,7 +813,11 @@ switch_to_logfile(char *logfile, int old_umask)
     (void) fclose(logfp);
   logfp = new_logfp;
 
-  plog(XLOG_INFO, "switched to logfile \"%s\"", logfile);
+  if (logfile)
+    plog(XLOG_INFO, "switched to logfile \"%s\"", logfile);
+  else
+    plog(XLOG_INFO, "no logfile defined; using stderr");
+
   return 0;
 }