diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-23 22:47:45 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-23 22:47:45 +0100 |
commit | f7804c608e017fe547b76190750337bddab8d596 (patch) | |
tree | 4c056ef0552a98adfbd0d86c20431cb1d98fb6af | |
parent | at should not be merge into cron (diff) | |
download | sat-f7804c608e017fe547b76190750337bddab8d596.tar.gz sat-f7804c608e017fe547b76190750337bddab8d596.tar.bz2 sat-f7804c608e017fe547b76190750337bddab8d596.tar.xz |
implement satq and satr, just sends a command
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r-- | src/satq.c | 17 | ||||
-rw-r--r-- | src/satr.c | 19 |
2 files changed, 34 insertions, 2 deletions
@@ -21,6 +21,9 @@ */ #include <stdio.h> #include <stdlib.h> +#include <errno.h> + +#include "client.h" @@ -43,6 +46,16 @@ usage(void) } +/** + * Print all queued jobs. + * + * @param argc Should be 1 or 0. + * @param argv The command line, should only include the name of the process. + * @return 0 The process was successful. + * @return 1 The process failed queuing the job. + * @return 2 User error, you do not know what you are doing. + * @return 3 satd(1) failed. + */ int main(int argc, char *argv[]) { @@ -52,6 +65,8 @@ main(int argc, char *argv[]) argv0 = argv[0]; } - /* TODO print the job queue */ + if (send_command(0, NULL)) + return errno ? (perror(argv0), 1) : 3; + return 0; } @@ -19,6 +19,11 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#include "client.h" @@ -41,6 +46,16 @@ usage(void) } +/** + * Run all queued jobs even if it is not time yet. + * + * @param argc Should be 1 or 0. + * @param argv The command line, should only include the name of the process. + * @return 0 The process was successful. + * @return 1 The process failed queuing the job. + * @return 2 User error, you do not know what you are doing. + * @return 3 satd(1) failed. + */ int main(int argc, char *argv[]) { @@ -50,6 +65,8 @@ main(int argc, char *argv[]) argv0 = argv[0]; } - /* TODO tell the daemon to start running jobs even if it is not time yet. */ + if (send_command(1, NULL)) + return errno ? (perror(argv0), 1) : 3; + return 0; } |