Formerly misc.c.~27~
authorRoland McGrath <roland@redhat.com>
Sun, 1 Aug 1993 20:03:45 +0000 (20:03 +0000)
committerRoland McGrath <roland@redhat.com>
Sun, 1 Aug 1993 20:03:45 +0000 (20:03 +0000)
misc.c

diff --git a/misc.c b/misc.c
index f7f04ce..d841bb2 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -509,9 +509,13 @@ log_access (flavor)
   if (! debug_flag)
     return;
 
-  printf ("%s access: user %d (real %d), group %d (real %d)\n",
-         flavor, geteuid (), getuid (), getegid (), getgid ());
-  fflush (stdout);
+  /* All the other debugging messages go to stdout,
+     but we write this one to stderr because it might be
+     run in a child fork whose stdout is piped.  */
+
+  fprintf (stderr, "%s access: user %d (real %d), group %d (real %d)\n",
+          flavor, geteuid (), getuid (), getegid (), getgid ());
+  fflush (stderr);
 }