Index: trunk/Ohana/src/imregister/base/WriteFIFO.c
===================================================================
--- trunk/Ohana/src/imregister/base/WriteFIFO.c	(revision 3)
+++ trunk/Ohana/src/imregister/base/WriteFIFO.c	(revision 3648)
@@ -1,26 +1,23 @@
 # include "imregister.h"
-
-static char retchar[] = "\n";
 
 int WriteFIFO (char *filename, char *line) {
 
   int state, mode;
-  int fd;
+  FILE *f;
 
-  fd = setlockfile2 (filename, 20.0, LCK_XCLD, &state);
-  if (fd == -1) {
-      fprintf (stderr, "ERROR: can't lock fifo %s\n", filename);
-      return (FALSE);
+  f = fsetlockfile (filename, 20.0, LCK_XCLD, &state);
+  if (f == NULL) {
+    fprintf (stderr, "ERROR: can't lock fifo %s\n", filename);
+    return (FALSE);
   }
 
-  lseek (fd, 0, SEEK_END);
-  write (fd, line, strlen (line));
-  write (fd, retchar, 1);
+  fseek (f, 0, SEEK_END);
+  fprintf (f, "%s\n", line);
 
   mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-  fchmod (fd, mode);
-  clearlockfile2 (filename, fd, LCK_XCLD, &state);
+  chmod (filename, mode);
+  fclearlockfile (filename, f, LCK_XCLD, &state);
 
   return (TRUE);
+}
 
-}
