X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstream-unix.c;h=d7dde8fc44f1e3c819c4d3eb6aab147fa08e90cb;hb=ca261b65354f522ba43c823221763ca6f4604e2d;hp=6ce7790b541dae2979b97670011b7d0a4bf4921a;hpb=539e96f62300e4afab00e5906a28e3b89301d62e;p=openvswitch diff --git a/lib/stream-unix.c b/lib/stream-unix.c index 6ce7790b..d7dde8fc 100644 --- a/lib/stream-unix.c +++ b/lib/stream-unix.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 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 #include #include +#include #include #include #include @@ -32,9 +33,9 @@ #include "util.h" #include "stream-provider.h" #include "stream-fd.h" - #include "vlog.h" -#define THIS_MODULE VLM_stream_unix + +VLOG_DEFINE_THIS_MODULE(stream_unix); /* Active UNIX socket. */ @@ -62,7 +63,7 @@ unix_open(const char *name, char *suffix, struct stream **streamp) bind_path, streamp); } -struct stream_class unix_stream_class = { +const struct stream_class unix_stream_class = { "unix", /* name */ unix_open, /* open */ NULL, /* close */ @@ -80,7 +81,8 @@ static int punix_accept(int fd, const struct sockaddr *sa, size_t sa_len, struct stream **streamp); static int -punix_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp) +punix_open(const char *name OVS_UNUSED, char *suffix, + struct pstream **pstreamp) { int fd, error; @@ -97,7 +99,7 @@ punix_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp) return error; } - return new_fd_pstream("punix", fd, punix_accept, + return new_fd_pstream(name, fd, punix_accept, xstrdup(suffix), pstreamp); } @@ -117,7 +119,7 @@ punix_accept(int fd, const struct sockaddr *sa, size_t sa_len, return new_fd_stream(name, fd, 0, NULL, streamp); } -struct pstream_class punix_pstream_class = { +const struct pstream_class punix_pstream_class = { "punix", punix_open, NULL,