#242 Reorder functions
Merged 5 years ago by rharwood. Opened 5 years ago by simo.
simo/gssproxy reordersock  into  master

file modified
+17 -17
@@ -140,16 +140,6 @@ 

      gpmctx->fd = -1;

  }

  

- static void gpm_epoll_close(struct gpm_ctx *gpmctx)

- {

-     if (gpmctx->epollfd < 0) {

-         return;

-     }

- 

-     close(gpmctx->epollfd);

-     gpmctx->epollfd = -1;

- }

- 

  static void gpm_timer_close(struct gpm_ctx *gpmctx)

  {

      if (gpmctx->timerfd < 0) {
@@ -160,13 +150,6 @@ 

      gpmctx->timerfd = -1;

  }

  

- static int gpm_release_sock(struct gpm_ctx *gpmctx)

- {

-     gpm_epoll_close(gpmctx);

-     gpm_timer_close(gpmctx);

-     return pthread_mutex_unlock(&gpmctx->lock);

- }

- 

  static int gpm_timer_setup(struct gpm_ctx *gpmctx, int timeout_seconds)

  {

      int ret;
@@ -197,6 +180,16 @@ 

      return 0;

  }

  

+ static void gpm_epoll_close(struct gpm_ctx *gpmctx)

+ {

+     if (gpmctx->epollfd < 0) {

+         return;

+     }

+ 

+     close(gpmctx->epollfd);

+     gpmctx->epollfd = -1;

+ }

+ 

  static int gpm_epoll_setup(struct gpm_ctx *gpmctx)

  {

      struct epoll_event ev;
@@ -224,6 +217,13 @@ 

      return ret;

  }

  

+ static int gpm_release_sock(struct gpm_ctx *gpmctx)

+ {

+     gpm_epoll_close(gpmctx);

+     gpm_timer_close(gpmctx);

+     return pthread_mutex_unlock(&gpmctx->lock);

+ }

+ 

  static int gpm_grab_sock(struct gpm_ctx *gpmctx)

  {

      int ret;

Keep related functions closer together like before

Signed-off-by: Simo Sorce simo@redhat.com

rebased onto dd21411

5 years ago

Commit 6accc0a fixes this pull-request

Pull-Request has been merged by rharwood

5 years ago