*** empty log message ***
[bpt/emacs.git] / src / hftctl.c
index 17a2c8c..a6daf0a 100644 (file)
 /*                                                             */
 /***************************************************************/
 
-
+#include <config.h>
+#include <sys/signal.h>
+#include <errno.h>
 #include <stdio.h>
 #include <fcntl.h>
-#include <errno.h>
 #include <setjmp.h>
 #include <sys/ioctl.h>
-#include <sys/signal.h>
 #include <sys/devinfo.h>
 #include <termios.h>
 #include <termio.h>
@@ -56,8 +56,6 @@
 #include <sys/tty.h>
 /* #include <sys/pty.h> */
 
-#include <config.h>
-
 #define REMOTE 0x01
 
 #undef ioctl
@@ -102,13 +100,13 @@ static struct hfctlack  ACK =
                                        /* read a buffer        */
 #define RD_BUF(f,p,l) \
         while ((l)) \
-          if ((j = read((f),(p),(l))) < 0) \
+          if ((j = emacs_read (f, p, l)) < 0) \
              if (errno != EINTR) return (-1); \
              else continue; \
           else { (l) -= j; (p) += j; }
 
 /*************** function prototypes ***************************/
-#ifdef __STDC__
+#ifdef PROTOTYPES
 static GT_ACK (int fd, int req, char *buf);
 static WR_REQ (int fd, int request, int cmdlen, char *cmd, int resplen);
 static void hft_alrm(int sig);
@@ -333,7 +331,7 @@ WR_REQ (fd, request, cmdlen, cmd, resplen)
     }
 
   /* write request to terminal   */
-  if (write(fd,p.c,size) == -1) return (-1);
+  if (emacs_write (fd, p.c, size) == -1) return (-1);
   if (p.req != &req)           /* free if allocated           */
     xfree (p.c);
   return (0);