~ubuntu-branches/ubuntu/trusty/ceph/trusty-updates

« back to all changes in this revision

Viewing changes to src/common/admin_socket.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-04-09 11:14:03 UTC
  • mfrom: (1.1.33)
  • Revision ID: package-import@ubuntu.com-20140409111403-jlql95pa8kg1nk9a
Tags: 0.79-0ubuntu1
* New upstream release (LP: #1278466):
  - d/p/modules.patch: Refreshed.
  - d/ceph.install: Install all jerasure modules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
static void remove_cleanup_file(const char *file)
66
66
{
67
67
  pthread_mutex_lock(&cleanup_lock);
68
 
  TEMP_FAILURE_RETRY(unlink(file));
 
68
  VOID_TEMP_FAILURE_RETRY(unlink(file));
69
69
  for (std::vector <const char*>::iterator i = cleanup_files.begin();
70
70
       i != cleanup_files.end(); ++i) {
71
71
    if (strcmp(file, *i) == 0) {
82
82
  pthread_mutex_lock(&cleanup_lock);
83
83
  for (std::vector <const char*>::iterator i = cleanup_files.begin();
84
84
       i != cleanup_files.end(); ++i) {
85
 
    TEMP_FAILURE_RETRY(unlink(*i));
 
85
    VOID_TEMP_FAILURE_RETRY(unlink(*i));
86
86
    free((void*)*i);
87
87
  }
88
88
  cleanup_files.clear();
111
111
    m_shutdown_wr_fd(-1),
112
112
    m_lock("AdminSocket::m_lock"),
113
113
    m_version_hook(NULL),
114
 
    m_help_hook(NULL)
 
114
    m_help_hook(NULL),
 
115
    m_getdescs_hook(NULL)
115
116
{
116
117
}
117
118
 
172
173
  int r = fcntl(sock_fd, F_SETFD, FD_CLOEXEC);
173
174
  if (r < 0) {
174
175
    r = errno;
175
 
    TEMP_FAILURE_RETRY(::close(sock_fd));
 
176
    VOID_TEMP_FAILURE_RETRY(::close(sock_fd));
176
177
    ostringstream oss;
177
178
    oss << "AdminSocket::bind_and_listen: failed to fcntl on socket: " << cpp_strerror(r);
178
179
    return oss.str();
193
194
        err = EEXIST;
194
195
      } else {
195
196
        ldout(m_cct, 20) << "unlink stale file " << sock_path << dendl;
196
 
        TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
 
197
        VOID_TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
197
198
        if (bind(sock_fd, (struct sockaddr*)&address,
198
199
                 sizeof(struct sockaddr_un)) == 0) {
199
200
          err = 0;
217
218
    oss << "AdminSocket::bind_and_listen: "
218
219
          << "failed to listen to socket: " << cpp_strerror(err);
219
220
    close(sock_fd);
220
 
    TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
 
221
    VOID_TEMP_FAILURE_RETRY(unlink(sock_path.c_str()));
221
222
    return oss.str();
222
223
  }
223
224
  *fd = sock_fd;
386
387
  }
387
388
  m_lock.Unlock();
388
389
 
389
 
  TEMP_FAILURE_RETRY(close(connection_fd));
 
390
  VOID_TEMP_FAILURE_RETRY(close(connection_fd));
390
391
  return rval;
391
392
}
392
393
 
551
552
  // Send a byte to the shutdown pipe that the thread is listening to
552
553
  char buf[1] = { 0x0 };
553
554
  int ret = safe_write(m_shutdown_wr_fd, buf, sizeof(buf));
554
 
  TEMP_FAILURE_RETRY(close(m_shutdown_wr_fd));
 
555
  VOID_TEMP_FAILURE_RETRY(close(m_shutdown_wr_fd));
555
556
  m_shutdown_wr_fd = -1;
556
557
 
557
558
  if (ret == 0) {