pipe-logging-fix-20050610
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 10 Jun 2005 22:37:37 +0000 (22:37 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 10 Jun 2005 22:37:37 +0000 (22:37 +0000)
fstat calls should be lstat

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

fstat calls should be lstat

bang in the wrong place

src/bozo/bosserver.c
src/util/serverLog.c

index 9fab1c0..90a8bca 100644 (file)
@@ -870,8 +870,8 @@ main(int argc, char **argv, char **envp)
 
     if ((!DoSyslog)
 #ifndef AFS_NT40_ENV
-       && (!(fstat(AFSDIR_BOZLOG_FILE, &sb) == 0) && 
-       (S_ISFIFO(sb.st_mode)))
+       && ((lstat(AFSDIR_BOZLOG_FILE, &sb) == 0) && 
+       !(S_ISFIFO(sb.st_mode)))
 #endif
        ) {
        strcpy(namebuf, AFSDIR_BOZLOG_FILE);
index 5145e8e..2f1e78b 100644 (file)
@@ -241,7 +241,7 @@ OpenLog(const char *fileName)
     }
 
     /* Support named pipes as logs by not rotating them */
-    if ((fstat(fileName, &statbuf) == 0)  && (S_ISFIFO(statbuf.st_mode))) {
+    if ((lstat(fileName, &statbuf) == 0)  && (S_ISFIFO(statbuf.st_mode))) {
        isfifo = 1;
     }
 #endif
@@ -314,7 +314,7 @@ ReOpenLog(const char *fileName)
     }
 
     /* Support named pipes as logs by not rotating them */
-    if ((fstat(fileName, &statbuf) == 0)  && (S_ISFIFO(statbuf.st_mode))) {
+    if ((lstat(fileName, &statbuf) == 0)  && (S_ISFIFO(statbuf.st_mode))) {
        isfifo = 1;
     }
 #endif