Permalink
Browse files

vsnprintf on windows is _vsnprintf, we should use strerror instead of…

… just the error code (which is useless to the user) when bailing on write error
  • Loading branch information...
1 parent 446237c commit 7125fb157910ae57557beebd3fce41265bf36a63 @Justasic Justasic committed Apr 30, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 include/platform.h
  2. +1 −1 src/queue.c
View
@@ -52,6 +52,7 @@
# define ERRNO errno
#else
# define snprintf sprintf_s
+# define vsnprintf _vsnprintf
# define close_portable closesocket
# define ERRNO WSAGetLastError()
# define errno GetLastError()
View
@@ -103,7 +103,7 @@ void sendq_dump(socket_t sock)
{
ssize_t bytes = write(q->sock, q->string, q->len);
if(bytes == -1)
- sigyn_fatal("Error writing to socket: %d", ERRNO);
+ sigyn_fatal("Error writing to socket: %s", strerror(ERRNO));
me.stats.outB += bytes;
mowgli_node_delete(n, &sendq);
}

0 comments on commit 7125fb1

Please sign in to comment.