]> granicus.if.org Git - strace/commitdiff
process_vm_readv may return ESRCH if tracee was killed, don't complain
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Sep 2012 11:53:37 +0000 (13:53 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Sep 2012 11:53:37 +0000 (13:53 +0200)
Discovered by running test/sigkill_rain under strace.

* util.c (umoven): Do not emit error message if process_vm_readv
fails with ESRCH.
(umovestr): LikeWise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util.c

diff --git a/util.c b/util.c
index 3975f492b5b38d67e139dce28e0dfa33a03ecc85..9ca49b27f68f3ed6d1ace9afde99115953d0b1e3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -789,7 +789,7 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr)
                if (r < 0) {
                        if (errno == ENOSYS)
                                process_vm_readv_not_supported = 1;
-                       else if (errno != EINVAL) /* EINVAL is seen if process is gone */
+                       else if (errno != EINVAL && errno != ESRCH) /* EINVAL is seen if process is gone */
                                /* strange... */
                                perror("process_vm_readv");
                        goto vm_readv_didnt_work;
@@ -899,7 +899,7 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr)
                        if (r < 0) {
                                if (errno == ENOSYS)
                                        process_vm_readv_not_supported = 1;
-                               else if (errno != EINVAL) /* EINVAL is seen if process is gone */
+                               else if (errno != EINVAL && errno != ESRCH) /* EINVAL is seen if process is gone */
                                        /* strange... */
                                        perror("process_vm_readv");
                                goto vm_readv_didnt_work;