diff --git a/bin/xbps-fbulk/main.c b/bin/xbps-fbulk/main.c index 44d58a2f..e9ed5a53 100644 --- a/bin/xbps-fbulk/main.c +++ b/bin/xbps-fbulk/main.c @@ -62,6 +62,7 @@ #define _BSD_SOURCE # include #undef _BSD_SOURCE +#include #include @@ -547,8 +548,11 @@ main(int argc, char **argv) char *bpath, *rpath, *minit, *tmp, cwd[PATH_MAX-1]; size_t blen; int ch; + const struct option longopts[] = { + { NULL, 0, NULL, 0 } + }; - while ((ch = getopt(argc, argv, "a:hj:l:v")) != -1) { + while ((ch = getopt_long(argc, argv, "a:hj:l:v", longopts, NULL)) != -1) { switch (ch) { case 'a': TargetArch = optarg; diff --git a/bin/xbps-uchroot/main.c b/bin/xbps-uchroot/main.c index c06b3385..ac386c90 100644 --- a/bin/xbps-uchroot/main.c +++ b/bin/xbps-uchroot/main.c @@ -51,6 +51,7 @@ #include /* PATH_MAX */ #include #include +#include #include #include "queue.h" @@ -283,11 +284,14 @@ main(int argc, char **argv) int c, clone_flags, child_status = 0; pid_t child; bool overlayfs = false; + const struct option longopts[] = { + { NULL, 0, NULL, 0 } + }; tmpfs_opts = chrootdir = cmd = NULL; argv0 = argv[0]; - while ((c = getopt(argc, argv, "Oto:b:V")) != -1) { + while ((c = getopt_long(argc, argv, "Oto:b:V", longopts, NULL)) != -1) { switch (c) { case 'O': overlayfs = true; diff --git a/bin/xbps-uhelper/main.c b/bin/xbps-uhelper/main.c index 729803ef..3df1fffd 100644 --- a/bin/xbps-uhelper/main.c +++ b/bin/xbps-uhelper/main.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "../xbps-install/defs.h" @@ -106,8 +107,11 @@ main(int argc, char **argv) const char *version, *rootdir = NULL, *confdir = NULL; char *pkgname, *hash, *filename; int flags = 0, c, rv = 0; + const struct option longopts[] = { + { NULL, 0, NULL, 0 } + }; - while ((c = getopt(argc, argv, "C:dr:V")) != -1) { + while ((c = getopt_long(argc, argv, "C:dr:V", longopts, NULL)) != -1) { switch (c) { case 'C': confdir = optarg; diff --git a/bin/xbps-uunshare/main.c b/bin/xbps-uunshare/main.c index 7abe5639..9bb43fc9 100644 --- a/bin/xbps-uunshare/main.c +++ b/bin/xbps-uunshare/main.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "queue.h" @@ -128,11 +129,14 @@ main(int argc, char **argv) const char *chrootdir, *cmd, *argv0; char **cmdargs, buf[32]; int c, fd; + const struct option longopts[] = { + { NULL, 0, NULL, 0 } + }; chrootdir = cmd = NULL; argv0 = argv[0]; - while ((c = getopt(argc, argv, "b:V")) != -1) { + while ((c = getopt_long(argc, argv, "b:V", longopts, NULL)) != -1) { switch (c) { case 'b': if (optarg == NULL || *optarg == '\0')