ofproto: Only dump queue statistics if the queue really exists.
[sliver-openvswitch.git] / lib / stream-fd.c
index 46aa8e7..ef4dc8d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 #include <poll.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/socket.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include "fatal-signal.h"
@@ -30,9 +31,9 @@
 #include "util.h"
 #include "stream-provider.h"
 #include "stream.h"
-
 #include "vlog.h"
-#define THIS_MODULE VLM_stream_fd
+
+VLOG_DEFINE_THIS_MODULE(stream_fd)
 
 /* Active file descriptor stream. */
 
@@ -139,6 +140,8 @@ static struct stream_class stream_fd_class = {
     fd_connect,                 /* connect */
     fd_recv,                    /* recv */
     fd_send,                    /* send */
+    NULL,                       /* run */
+    NULL,                       /* run_wait */
     fd_wait,                    /* wait */
 };
 \f
@@ -211,7 +214,7 @@ pfd_accept(struct pstream *pstream, struct stream **new_streamp)
 
     new_fd = accept(ps->fd, (struct sockaddr *) &ss, &ss_len);
     if (new_fd < 0) {
-        int retval = errno;
+        retval = errno;
         if (retval != EAGAIN) {
             VLOG_DBG_RL(&rl, "accept: %s", strerror(retval));
         }