Prepare for -yy option support
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 8 Aug 2014 23:38:26 +0000 (23:38 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 8 Aug 2014 23:38:26 +0000 (23:38 +0000)
* defs.h (show_fd_path): Change type to unsigned int.
* strace.c (show_fd_path): Likewise.
(init): Handle repeated -y option.

defs.h
strace.c

diff --git a/defs.h b/defs.h
index b92fa7b753d33ea2089d7aa235a2b22806adeb08..625cac673d5deb9bb79e74ee9b35c06dd6670cfe 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -562,7 +562,7 @@ extern bool iflag;
 extern bool count_wallclock;
 extern unsigned int qflag;
 extern bool not_failing_only;
-extern bool show_fd_path;
+extern unsigned int show_fd_path;
 extern bool hide_log_until_execve;
 /* are we filtering traces based on paths? */
 extern const char **paths_selected;
index 4154cde66b0f3bec775a22a711e779c4c999575b..2bc5c675f1c7f850aa58982b0d7b96225e5d6fac 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -129,7 +129,7 @@ static int post_attach_sigstop = TCB_IGNORE_ONE_SIGSTOP;
 bool not_failing_only = 0;
 
 /* Show path associated with fd arguments */
-bool show_fd_path = 0;
+unsigned int show_fd_path = 0;
 
 static bool detach_on_execve = 0;
 /* Are we "strace PROG" and need to skip detach on first execve? */
@@ -1734,7 +1734,7 @@ init(int argc, char *argv[])
                        xflag++;
                        break;
                case 'y':
-                       show_fd_path = 1;
+                       show_fd_path++;
                        break;
                case 'v':
                        qualify("abbrev=none");