From 72dd49d7dd07ba4cae13ee1249fd58550991c188 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 30 Dec 2019 20:31:24 +0000 Subject: Rename cd/umask to execline-cd/execline-umask, make symlinks, etc. --- src/execline/cd.c | 16 ---------------- src/execline/deps-exe/cd | 1 - src/execline/deps-exe/execline-cd | 1 + src/execline/deps-exe/execline-umask | 1 + src/execline/deps-exe/umask | 1 - src/execline/execline-cd.c | 16 ++++++++++++++++ src/execline/execline-umask.c | 18 ++++++++++++++++++ src/execline/umask.c | 18 ------------------ src/execline/wait.c | 10 ++++++++++ 9 files changed, 46 insertions(+), 36 deletions(-) delete mode 100644 src/execline/cd.c delete mode 100644 src/execline/deps-exe/cd create mode 100644 src/execline/deps-exe/execline-cd create mode 100644 src/execline/deps-exe/execline-umask delete mode 100644 src/execline/deps-exe/umask create mode 100644 src/execline/execline-cd.c create mode 100644 src/execline/execline-umask.c delete mode 100644 src/execline/umask.c (limited to 'src') diff --git a/src/execline/cd.c b/src/execline/cd.c deleted file mode 100644 index 62b877c..0000000 --- a/src/execline/cd.c +++ /dev/null @@ -1,16 +0,0 @@ -/* ISC license. */ - -#include -#include -#include - -#define USAGE "cd path prog..." - -int main (int argc, char const *const *argv, char const *const *envp) -{ - PROG = "cd" ; - if (argc < 3) strerr_dieusage(100, USAGE) ; - if (chdir(argv[1]) == -1) - strerr_diefu2sys(111, "chdir to ", argv[1]) ; - xpathexec_run(argv[2], argv+2, envp) ; -} diff --git a/src/execline/deps-exe/cd b/src/execline/deps-exe/cd deleted file mode 100644 index e7187fe..0000000 --- a/src/execline/deps-exe/cd +++ /dev/null @@ -1 +0,0 @@ --lskarnet diff --git a/src/execline/deps-exe/execline-cd b/src/execline/deps-exe/execline-cd new file mode 100644 index 0000000..e7187fe --- /dev/null +++ b/src/execline/deps-exe/execline-cd @@ -0,0 +1 @@ +-lskarnet diff --git a/src/execline/deps-exe/execline-umask b/src/execline/deps-exe/execline-umask new file mode 100644 index 0000000..e7187fe --- /dev/null +++ b/src/execline/deps-exe/execline-umask @@ -0,0 +1 @@ +-lskarnet diff --git a/src/execline/deps-exe/umask b/src/execline/deps-exe/umask deleted file mode 100644 index e7187fe..0000000 --- a/src/execline/deps-exe/umask +++ /dev/null @@ -1 +0,0 @@ --lskarnet diff --git a/src/execline/execline-cd.c b/src/execline/execline-cd.c new file mode 100644 index 0000000..8f308f3 --- /dev/null +++ b/src/execline/execline-cd.c @@ -0,0 +1,16 @@ +/* ISC license. */ + +#include +#include +#include + +#define USAGE "cd path prog..." + +int main (int argc, char const *const *argv, char const *const *envp) +{ + PROG = "execline-cd" ; + if (argc < 3) strerr_dieusage(100, USAGE) ; + if (chdir(argv[1]) == -1) + strerr_diefu2sys(111, "chdir to ", argv[1]) ; + xpathexec_run(argv[2], argv+2, envp) ; +} diff --git a/src/execline/execline-umask.c b/src/execline/execline-umask.c new file mode 100644 index 0000000..a7888a6 --- /dev/null +++ b/src/execline/execline-umask.c @@ -0,0 +1,18 @@ +/* ISC license. */ + +#include +#include +#include +#include + +#define USAGE "umask value prog..." + +int main (int argc, char const *const *argv, char const *const *envp) +{ + unsigned int m ; + PROG = "execline-umask" ; + if (argc < 3) strerr_dieusage(100, USAGE) ; + if (!uint_oscan(argv[1], &m)) strerr_dieusage(100, USAGE) ; + umask(m) ; + xpathexec_run(argv[2], argv+2, envp) ; +} diff --git a/src/execline/umask.c b/src/execline/umask.c deleted file mode 100644 index f74f845..0000000 --- a/src/execline/umask.c +++ /dev/null @@ -1,18 +0,0 @@ -/* ISC license. */ - -#include -#include -#include -#include - -#define USAGE "umask value prog..." - -int main (int argc, char const *const *argv, char const *const *envp) -{ - unsigned int m ; - PROG = "umask" ; - if (argc < 3) strerr_dieusage(100, USAGE) ; - if (!uint_oscan(argv[1], &m)) strerr_dieusage(100, USAGE) ; - umask(m) ; - xpathexec_run(argv[2], argv+2, envp) ; -} diff --git a/src/execline/wait.c b/src/execline/wait.c index 2a2ead2..726cd52 100644 --- a/src/execline/wait.c +++ b/src/execline/wait.c @@ -1,7 +1,13 @@ /* ISC license. */ +#include + #include #include +#ifdef EXECLINE_PEDANTIC_POSIX +#include +#endif + #include #include #include @@ -9,6 +15,7 @@ #include #include #include + #include #define USAGE "wait [ -I | -i ] [ -r | -t timeout ] { pids... }" @@ -109,6 +116,9 @@ int main (int argc, char const **argv, char const *const *envp) int r ; int hasblock ; PROG = "wait" ; +#ifdef EXECLINE_PEDANTIC_POSIX + setlocale(LC_ALL, "") ; /* but of course, dear POSIX */ +#endif { subgetopt_t l = SUBGETOPT_ZERO ; unsigned int t = 0 ; -- cgit v1.2.3