X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command.c;h=a9f5aa697be2e3f7ab51819898b14afb7d0535c6;hp=09f00f2f23d7479c5a567fa8fe85a357088b1ff0;hb=32a81d7eecfa5c8585d7095631ff2cd8b7b1bf7a;hpb=b59a2064b8dcc9fc83c32f14d6520b266d90a8cb diff --git a/command.c b/command.c index 09f00f2f..a9f5aa69 100644 --- a/command.c +++ b/command.c @@ -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 @@ static int com_sender(struct command_context *cc) 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; @@ -759,6 +761,16 @@ out: return ret; } +static int com_tasks(struct command_context *cc) +{ + char *tl = server_get_tasks(); + int ret = 1; + + if (tl) + ret = send_sb(&cc->scc, tl, strlen(tl), SBD_OUTPUT, false); + return ret; +} + /* * check if perms are sufficient to exec a command having perms cmd_perms. * Returns 0 if perms are sufficient, -E_PERM otherwise.