after

Echo a string after process dies
git clone _git@git.zakaria.org/after.git
Log | Files | Refs | README | LICENSE

commit 3578aa9d0622817a006202634cc34d3cb7aeceb5
parent 753591348eeef53432881db373e9f668b371774d
Author: e-zk <58356365+e-zk@users.noreply.github.com>
Date:   Sat,  2 Jan 2021 20:15:39 +1000

output usage to stderr

Diffstat:
Mafter.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/after.c b/after.c @@ -4,11 +4,11 @@ #include <err.h> #include <fcntl.h> #include <kvm.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <limits.h> char *progname; int verbose; @@ -16,7 +16,7 @@ int verbose; void usage(char *progname) { - printf("usage: %s [-h] [-v] [-p pid | -n process_name] -e string\n", + fprintf(stderr, "usage: %s [-h] [-v] [-p pid | -n process_name] -e string\n", progname); } @@ -138,7 +138,6 @@ main(int argc, char *argv[]) sleep(1); } - debug_print("process not in process list (died?)."); printf("%s\n", cmd);