about summary refs log tree commit diff
path: root/gmon
diff options
context:
space:
mode:
Diffstat (limited to 'gmon')
-rw-r--r--gmon/bb_exit_func.c11
-rw-r--r--gmon/gmon.c2
2 files changed, 7 insertions, 6 deletions
diff --git a/gmon/bb_exit_func.c b/gmon/bb_exit_func.c
index 032e4f68b2..4ba79885c1 100644
--- a/gmon/bb_exit_func.c
+++ b/gmon/bb_exit_func.c
@@ -57,7 +57,7 @@ __bb_exit_func (void)
     }
   memcpy (&ghdr.cookie[0], GMON_MAGIC, 4);
   memcpy (&ghdr.version, &version, sizeof (version));
-  fwrite (&ghdr, sizeof (ghdr), 1, fp);
+  fwrite_unlocked (&ghdr, sizeof (ghdr), 1, fp);
 
   for (ptr = __bb_head; ptr != 0; ptr = ptr->next)
     {
@@ -66,13 +66,14 @@ __bb_exit_func (void)
       u_int i;
 
       tag = GMON_TAG_BB_COUNT;
-      fwrite (&tag, sizeof (tag), 1, fp);
-      fwrite (&ncounts, sizeof (ncounts), 1, fp);
+      fwrite_unlocked (&tag, sizeof (tag), 1, fp);
+      fwrite_unlocked (&ncounts, sizeof (ncounts), 1, fp);
 
       for (i = 0; i < ncounts; ++i)
 	{
-	  fwrite (&ptr->addresses[i], sizeof (ptr->addresses[0]), 1, fp);
-	  fwrite (&ptr->counts[i], sizeof (ptr->counts[0]), 1, fp);
+	  fwrite_unlocked (&ptr->addresses[i], sizeof (ptr->addresses[0]), 1,
+			   fp);
+	  fwrite_unlocked (&ptr->counts[i], sizeof (ptr->counts[0]), 1, fp);
 	}
     }
   fclose (fp);
diff --git a/gmon/gmon.c b/gmon/gmon.c
index 834351eeec..a3cb9362f7 100644
--- a/gmon/gmon.c
+++ b/gmon/gmon.c
@@ -58,7 +58,7 @@ struct gmonparam _gmonparam = { GMON_PROF_OFF };
 static int	s_scale;
 #define		SCALE_1_TO_1	0x10000L
 
-#define ERR(s) write(2, s, sizeof(s) - 1)
+#define ERR(s) __write(2, s, sizeof(s) - 1)
 
 void moncontrol __P ((int mode));
 void __moncontrol __P ((int mode));