diff options
author | Jim Meyering <jim@meyering.net> | 1999-08-15 12:56:00 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-08-15 12:56:00 +0000 |
commit | 7228350401c5f304f32e7e64873da83e40f3410f (patch) | |
tree | 83bd7fd68100dd8dca9412878440bcf6f4134744 /src | |
parent | 22cdfc8955d4727b06a76e5894df9d9aa1d67b16 (diff) | |
download | coreutils-7228350401c5f304f32e7e64873da83e40f3410f.tar.xz |
(ENOSYS): Define to a bogus value if not already defined.
(parse_options): Warn if --pid=PID is used and kill()
returns ENOSYS (e.g. when compiled with DJGPP).
Diffstat (limited to 'src')
-rw-r--r-- | src/tail.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tail.c b/src/tail.c index b1b4b4490..40ce9f02a 100644 --- a/src/tail.c +++ b/src/tail.c @@ -51,6 +51,12 @@ # define OFF_T_MAX TYPE_MAXIMUM (off_t) #endif +#ifndef ENOSYS + /* Some systems don't have ENOSYS -- this should be a big enough + value that no valid errno value will match it. */ +# define ENOSYS 99999 +#endif + /* Number of items to tail. */ #define DEFAULT_N_LINES 10 @@ -1435,6 +1441,11 @@ parse_options (int argc, char **argv, if (pid && !forever) error (0, 0, _("warning: PID ignored; --pid=PID is useful only when following")); + else if (pid && kill (pid, 0) != 0 && errno == ENOSYS) + { + error (0, 0, _("warning: --pid=PID is not supported on this system")); + pid = 0; + } } int |