Merge branch 'refs/heads/t/kill_usleep'
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 14 Dec 2014 20:47:37 +0000 (21:47 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 14 Dec 2014 20:47:37 +0000 (21:47 +0100)
1  2 
command.c

diff --combined command.c
+++ b/command.c
@@@ -35,8 -35,8 +35,8 @@@
  #include "fd.h"
  #include "ipc.h"
  #include "user_list.h"
 -#include "server_command_list.h"
 -#include "afs_command_list.h"
 +#include "server.command_list.h"
 +#include "afs.command_list.h"
  #include "signal.h"
  #include "version.h"
  
@@@ -363,8 -363,10 +363,10 @@@ static int com_sender(struct command_co
        for (i = 0; i < 10; i++) {
                mutex_lock(mmd_mutex);
                if (mmd->sender_cmd_data.cmd_num >= 0) {
+                       /* another sender command is active, retry in 100ms */
+                       struct timespec ts = {.tv_nsec = 100 * 1000 * 1000};
                        mutex_unlock(mmd_mutex);
-                       usleep(100 * 1000);
+                       nanosleep(&ts, NULL);
                        continue;
                }
                mmd->sender_cmd_data = scd;