# HG changeset patch # User viric@mandarina # Date 1234729688 -3600 # Node ID 0d831e6cf8ef700c2ac3eb233fa5db3d2dbfdd0e # Parent b23c426568d3359cd75291bab5a9e2fe0afff9b9 Making ts chdir to the socket directory. diff -r b23c426568d3 -r 0d831e6cf8ef Changelog --- a/Changelog Sun Feb 15 19:12:32 2009 +0100 +++ b/Changelog Sun Feb 15 21:28:08 2009 +0100 @@ -13,6 +13,8 @@ v0.6.3: - Fixed a bug on -c and -t. - Adding first support for -D (run depending on any job) + - Adding version control on the protocol. It will work only from now on. + - Making the ts server chdir to the socket directory, so it doesn't annoy on umounting. v0.6.2: - Fixed a bug on -w - Making -S return the number of slots diff -r b23c426568d3 -r 0d831e6cf8ef main.c --- a/main.c Sun Feb 15 19:12:32 2009 +0100 +++ b/main.c Sun Feb 15 21:28:08 2009 +0100 @@ -325,7 +325,7 @@ printf(" -K kill the task spooler server\n"); printf(" -C clear the list of finished jobs\n"); printf(" -l show the job list (default action)\n"); - printf(" -S [num] get/set the number of max simultanious jobs of the server.\n"); + printf(" -S [num] get/set the number of max simultaneous jobs of the server.\n"); printf(" -t [id] \"tail -n 10 -f\" the output of the job. Last run if not specified.\n"); printf(" -c [id] like -t, but shows all the lines. Last run if not specified.\n"); printf(" -p [id] show the pid of the job. Last run if not specified.\n"); diff -r b23c426568d3 -r 0d831e6cf8ef server.c --- a/server.c Sun Feb 15 19:12:32 2009 +0100 +++ b/server.c Sun Feb 15 21:28:08 2009 +0100 @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -151,12 +152,18 @@ int ls; struct sockaddr_un addr; int res; + char *dirpath; process_type = SERVER; max_descriptors = get_max_descriptors(); path = _path; + /* Move the server to the socket directory */ + dirpath = strdup(path); + chdir(dirname(dirpath)); + free(dirpath); + nconnections = 0; ls = socket(AF_UNIX, SOCK_STREAM, 0);