~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_unix_socket_protocol/protocol.cc

  • Committer: Joseph Daly
  • Date: 2010-10-30 01:01:48 UTC
  • mfrom: (1891 staging)
  • mto: This revision was merged to the branch mainline in revision 1900.
  • Revision ID: skinny.moey@gmail.com-20101030010148-k39lnrftv4bkbux9
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
bool Protocol::getFileDescriptors(std::vector<int> &fds)
80
80
{
81
81
  struct sockaddr_un servAddr;
 
82
  socklen_t addrlen;
82
83
  int unix_sock;
83
84
 
84
85
  if ((unix_sock= socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
97
98
 
98
99
  (void) setsockopt(unix_sock, SOL_SOCKET, SO_REUSEADDR, (char*)&arg, sizeof(arg));
99
100
 
100
 
  if (bind(unix_sock, reinterpret_cast<struct sockaddr *>(&servAddr), sizeof(servAddr)) < 0)
 
101
  addrlen= sizeof(servAddr);
 
102
  if (bind(unix_sock, reinterpret_cast<struct sockaddr *>(&servAddr), addrlen) < 0)
101
103
  { 
102
104
    std::cerr << "Can't start server : Bind on unix socket\n";
103
105
    std::cerr << "Do you already have another of drizzled or mysqld running on socket: " << "/tmp/mysql.socket" << "?\n";