]> git.pond.sub.org Git - empserver/commitdiff
(typed_wu) [_WIN32]: Remove special case, just use writev().
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 27 Oct 2007 14:40:10 +0000 (14:40 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 27 Oct 2007 14:40:10 +0000 (14:40 +0000)
src/lib/subs/wu.c

index 03bb39e078518dcab464d5cdf7985f63cb3e5c5f..7e379e231db60853ed8916038d88cf6985ddcc34 100644 (file)
@@ -35,9 +35,7 @@
 
 #include <fcntl.h>
 #include <stdarg.h>
-#if !defined(_WIN32)
 #include <sys/uio.h>
-#endif
 #include <unistd.h>
 #include "file.h"
 #include "misc.h"
@@ -120,9 +118,7 @@ typed_wu(natid from, natid to, char *message, int type)
     int len;
     struct telstr tel;
     struct natstr *np;
-#if !defined(_WIN32)
     struct iovec iov[2];
-#endif
     int fd;
     char box[1024];
     int write_ok = 0;
@@ -154,16 +150,11 @@ typed_wu(natid from, natid to, char *message, int type)
     }
     tel.tel_length = len;
     tel.tel_type = type;
-#if !defined(_WIN32)
     iov[0].iov_base = &tel;
     iov[0].iov_len = sizeof(tel);
     iov[1].iov_base = message;
     iov[1].iov_len = len;
     if (writev(fd, iov, 2) < (int)(iov[0].iov_len + iov[1].iov_len)) {
-#else
-    if ((write(fd, &tel, sizeof(tel)) != sizeof(tel)) ||
-       (write(fd, message, len) != len)) {
-#endif
        logerror("telegram 'write' to #%d failed", to);
     } else
        write_ok = 1;