]> granicus.if.org Git - strace/commitdiff
2006-10-14 Dmitry V. Levin <ldv@altlinux.org>
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 14 Oct 2006 14:23:57 +0000 (14:23 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 14 Oct 2006 14:23:57 +0000 (14:23 +0000)
* strace.c (main): Check getcwd() return code.

ChangeLog
strace.c

index b7715157931e15f3fca1e0cc9d35baa6d35e8928..cf9ee1a5612bcfd91037a23afe940a70cd2ca7fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-10-14  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * strace.c (main): Check getcwd() return code.
+
 2006-10-13  Ulrich Drepper  <drepper@redhat.com>
            Bernhard Kaindl <bk@suse.de>
            Dmitry V. Levin  <ldv@altlinux.org>
index 8ab1a35baef6162f255b5464e11b6d181ca2aa67..fd3f7bd289804e7512bf6af4ea6707d9fcfb14c5 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -519,7 +519,8 @@ Process %u attached - interrupt to quit\n",
                                else
                                        m = n = strlen(path);
                                if (n == 0) {
-                                       getcwd(pathname, MAXPATHLEN);
+                                       if (!getcwd(pathname, MAXPATHLEN))
+                                               continue;
                                        len = strlen(pathname);
                                }
                                else if (n > sizeof pathname - 1)