logging-enhancements-need-ctime-decl-20011011
[openafs.git] / src / util / assert.c
index 04399a9..4f52675 100644 (file)
@@ -1,29 +1,22 @@
-
-#ifndef lint
-#endif
-
 /*
-############################################################################
-#        Copyright IBM Corporation 1988, 1989 - All Rights Reserved        #
-#                                                                          #
-# Permission to use, copy, modify, and distribute this software and its    #
-# documentation for any purpose and without fee is hereby granted,         #
-# provided that the above copyright notice appear in all copies and        #
-# that both that copyright notice and this permission notice appear in     #
-# supporting documentation, and that the name of IBM not be used in        #
-# advertising or publicity pertaining to distribution of the software      #
-# without specific, written prior permission.                              #
-#                                                                          #
-# IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL #
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM #
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY      #
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER  #
-# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING   #
-# OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.    #
-############################################################################
-*/
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ * 
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
 /* ReallyAbort:  called from assert. May/85 */
+#include <afsconfig.h>
 #include <afs/param.h>
+#include <stdlib.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+RCSID("$Header$");
+
 #include <stdio.h>
 
 #ifdef AFS_NT40_ENV
@@ -36,7 +29,14 @@ void afs_NTAbort(void)
 
 void AssertionFailed(char *file, int line)
 {
-    fprintf(stderr, "Assertion failed! file %s, line %d.\n", file, line);
+    char tdate[26];
+    time_t when;
+
+    time(&when);
+    strcpy(tdate, ctime(&when));
+    tdate[24] = '0';
+    fprintf(stderr, "%s: Assertion failed! file %s, line %d.\n",
+       tdate, file, line);
     fflush(stderr);
 #ifdef AFS_NT40_ENV
     afs_NTAbort();