[nas] [patch] RFC: broken AIXV3 debug code?

Stefan Huehner stefan at huehner.org
Sat Aug 26 09:10:15 MDT 2006


Hi,

in server/os/utils.c there is some code to redirect error logging from
stderr to and file in tmp on AIXV3. As OpenDebug isn't called anywhere
this is broken when AIXV3 is defined. Additionally this logfile is fixed
in /tmp which permissions 00777.

Should this special case be kept and fixed?
Or should this be removed completely?

A patch for the latter case whith the code in questio is attached.

Regards,
Stefan

-------------- next part --------------
--- utils_orig.c	2006-08-26 17:06:52.000000000 +0200
+++ utils_work.c	2006-08-26 17:09:22.000000000 +0200
@@ -125,13 +125,6 @@
 #include <unistd.h>
 #endif
 
-#ifdef AIXV3
-#define AIXFILE "/tmp/aixfile"
-FILE *aixfd;
-int SyncOn = 0;
-extern int SelectWaitTime;
-#endif
-
 #ifdef DEBUG
 #ifndef SPECIAL_MALLOC
 /*#define MEMBUG - This breaks things with unknown CheckMemory call */
@@ -612,13 +605,6 @@
 ErrorF(char *f, char *s0, char *s1, char *s2, char *s3, char *s4, char *s5,
        char *s6, char *s7, char *s8, char *s9)
 {                               /* limit of ten args */
-#ifdef AIXV3
-    fprintf(aixfd, f, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9);
-    fflush(aixfd);
-
-    if (SyncOn)
-        sync();
-#else
 #ifdef AMOEBA
     mu_lock(&print_lock);
 #endif
@@ -626,21 +612,7 @@
 #ifdef AMOEBA
     mu_unlock(&print_lock);
 #endif
-#endif
 
     return;
 }
 
-#ifdef AIXV3
-void
-OpenDebug(void)
-{
-    if ((aixfd = fopen(AIXFILE, "w")) == NULL) {
-        fprintf(stderr, "open aixfile failed\n");
-        exit(-1);
-    }
-    chmod(AIXFILE, 00777);
-
-    return;
-}
-#endif


More information about the Nas mailing list