]> granicus.if.org Git - psmisc/commitdiff
more error checking on fuser kill
authorCraig Small <csmall@users.sourceforge.net>
Wed, 4 Jan 2006 01:37:13 +0000 (01:37 +0000)
committerCraig Small <csmall@users.sourceforge.net>
Wed, 4 Jan 2006 01:37:13 +0000 (01:37 +0000)
src/fuser.c

index da307d710e399ccd25d4629270059e66d226658a..b6f523aa3000c8dcd6d61b7680f355b693f531b0 100644 (file)
@@ -1167,6 +1167,12 @@ static void kill_matched_proc(struct procs *proc_head, const opt_type opts, cons
        for (pptr = proc_head ; pptr != NULL ; pptr = pptr->next ) {
                if ( (opts & OPT_INTERACTIVE) && (ask(pptr->pid) == 0))
                        continue;
-               kill (pptr->pid, sig_number);
+               if ( kill (pptr->pid, sig_number) < 0) {
+                       fprintf(stderr, _("Could not kill process %d: %s\n"),
+                                       pptr->pid,
+                                       strerror(errno)
+                               );
+               }
+                                       
        }
 }