diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index c3c155bce..20329f8fb 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +Sun Oct 7 23:06:39 2001 Christopher Faylor + + * kill.cc (main): Set exit value to 1 on invalid pid. Perform minor + cleanup. + Fri Sep 21 20:40:30 2001 Christopher Faylor * Makefile.in (mingw_getopt.o): Ensure that newlib include directories diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc index 8ca36bcda..626b07156 100644 --- a/winsup/utils/kill.cc +++ b/winsup/utils/kill.cc @@ -61,30 +61,23 @@ sig0: char *p; int pid = strtol (*argv, &p, 10); if (*p != '\0') - fprintf (stderr, "kill: illegal pid: %s\n", *argv); + { + fprintf (stderr, "kill: illegal pid: %s\n", *argv); + ret = 1; + } + else if (kill (pid, sig) == 0) + { + if (force) + forcekill (pid, sig, 1); + } + else if (force && sig != 0) + forcekill (pid, sig, 0); else { -#if 0 - printf ("Sending %s(%d) signal to pid %d\n", - strsignal (sig), sig, pid); -#endif - if (kill (pid, sig) == 0) - { - if (force) - forcekill (pid, sig, 1); - } - else - { - if (force && sig != 0) - forcekill (pid, sig, 0); - else - { - char buf[1000]; - sprintf (buf, "kill %d", pid); - perror (buf); - ret = 1; - } - } + char buf[1000]; + sprintf (buf, "kill %d", pid); + perror (buf); + ret = 1; } argv++; } diff --git a/winsup/utils/utils.sgml b/winsup/utils/utils.sgml index 84f956988..1f25c3423 100644 --- a/winsup/utils/utils.sgml +++ b/winsup/utils/utils.sgml @@ -344,6 +344,7 @@ Usage mount -b = text files are equivalent to binary files (newline = \n) -x = files in the mounted directory are automatically given execute permission. + -X = files in the mounted directory are automatically given execute permission and are assumed to be Cygwin (i.e., not generic windows) executables only. -f = force mount, don't warn about missing mount point directories -s = add mount point to system-wide registry location --change-automount-prefix = change path prefix used for automatic mount points