diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-28 01:43:39 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-28 01:43:39 +0100 |
commit | 0de4466f7cefb55584b24589acaca2284fea8d24 (patch) | |
tree | 3097f66bc66a0e132902243bc6ef97f699a56710 /src/satq.c | |
parent | the socket shall be opened on fd 3 (you will see why later) (diff) | |
download | sat-0de4466f7cefb55584b24589acaca2284fea8d24.tar.gz sat-0de4466f7cefb55584b24589acaca2284fea8d24.tar.bz2 sat-0de4466f7cefb55584b24589acaca2284fea8d24.tar.xz |
fix errors and tidy up
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r-- | src/satq.c | 28 |
1 files changed, 5 insertions, 23 deletions
@@ -19,31 +19,14 @@ * 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" +#include "common.h" -/** - * The name of the process. - */ -char *argv0 = "satq"; - - +COMMAND("satq") +USAGE(NULL) -/** - * Print usage information. - */ -static void -usage(void) -{ - fprintf(stderr, "usage: %s\n", - strrchr(argv0) ? (strrchr(argv0) + 1) : argv0); - exit(2); -} /** @@ -62,8 +45,7 @@ main(int argc, char *argv[]) if (argc > 0) argv0 = argv[0]; if (argc > 1) usage(); - if (send_command(SAT_PRINT, 0, NULL)) - return errno ? (perror(argv0), 1) : 3; - return 0; + SEND(SAT_PRINT, 0, NULL)); + END(NULL); } |