From fde02eafff1ec7c16666f689a6bb62e7a78d6671 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sat, 3 Feb 2024 18:03:23 +0100 Subject: code made POSIX-compliant --- rpt.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/rpt.c b/rpt.c index 46a3de9..392e442 100644 --- a/rpt.c +++ b/rpt.c @@ -2,7 +2,6 @@ #include #include -#include #include #include #include @@ -80,7 +79,7 @@ exec_child(char **argv) if (stdin_clone) { - status = lseek(clone_fd, 0, L_SET); + status = lseek(clone_fd, 0, SEEK_SET); if (status < 0) { @@ -177,23 +176,13 @@ copy_stdin() int main(int argc, char* argv[]) { - struct option const opts[] = { - {"count", required_argument, NULL, 'n'}, - {"force", no_argument, NULL, 'f'}, - {"version", no_argument, NULL, 'V'}, - {"help", no_argument, NULL, 'h'}, - {NULL, 0, NULL, 0} - }; - - opterr = 0; /* dismiss getopt error message */ int opt; - char *strcount = NULL; long count = 1; void (*handle_error_f)(int status) = exit_on_error; - while ((opt = getopt_long(argc, argv, "+:n:fVh", opts, NULL)) >= 0) + while ((opt = getopt(argc, argv, ":n:fVh")) != -1) { switch(opt) { -- cgit v1.2.3