Hi,
Sorry for broken patch.

Attached patch can be applied.

Thanks,
Sinan.

On Tue, 6 Apr 2010, Denys Vlasenko wrote:

On Tuesday 06 April 2010 08:51, Sinan Nalkaya wrote:

Hi,

I intended to use "Show Threads" feature in ps without -w option is enabled, 
but i couldn't.

Is there a specific reason for that?

This patch seems to be fixing the issue if there is no specific reason for that.

Patch does not apply:

$ patch -p1 </tmp/z.patch --dry-run
patching file procps/ps.c
Hunk #1 FAILED at 548.
Hunk #2 FAILED at 576.
2 out of 2 hunks FAILED -- saving rejects to file procps/ps.c.rej

--
vda
diff --git a/procps/ps.c b/procps/ps.c
index 91ebd68..c44ea7e 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -548,8 +548,11 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
 	unsigned terminal_width;
 #endif
 
-#if ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX
+#if ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX || ENABLE_FEATURE_SHOW_THREADS
 	int opts;
+#endif
+
+#if ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX
 # if ENABLE_FEATURE_PS_WIDE
 	int w_count = 0;
 	opt_complementary = "-:ww";
@@ -573,11 +576,14 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
 		psscan_flags = PSSCAN_PID | PSSCAN_CONTEXT
 				| PSSCAN_STATE | PSSCAN_COMM;
 # endif
+# elif ENABLE_FEATURE_SHOW_THREADS
+	opts = getopt32(argv, "T");
+#endif /* ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX */
+
 # if ENABLE_FEATURE_SHOW_THREADS
 	if (opts & (1 << ENABLE_SELINUX))
 		psscan_flags |= PSSCAN_TASKS;
-# endif
-#endif /* ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX */
+#endif
 
 	if (psscan_flags & PSSCAN_CONTEXT)
 		puts("  PID CONTEXT                          STAT COMMAND");
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to