X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command.c;h=661b2a8a079a42a17057cce9dce0faa9d9d2a709;hp=09f00f2f23d7479c5a567fa8fe85a357088b1ff0;hb=3a6b996d8b39fdc067df352d1eee757ef2a8f49b;hpb=b59a2064b8dcc9fc83c32f14d6520b266d90a8cb diff --git a/command.c b/command.c index 09f00f2f..661b2a8a 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" @@ -210,7 +210,7 @@ static int check_sender_args(int argc, char * const * argv, struct sender_comman * * The nonblock flag must be disabled for the file descriptor given by \a scc. * - * Stream cipher encryption is automatically activated if neccessary via the + * Stream cipher encryption is automatically activated if necessary via the * sideband transformation, depending on the value of \a band. * * \return Standard. @@ -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.