From: George Wang <x...@redhat.com>

function(3) system will raise the SIGCHILD signal to parent process,
which should cause the test case failed(especially to btrfs). ignorce
it before calling the system function and restore it after the calling.

Signed-off-by: George Wang <x...@redhat.com>
---
 lib/tst_mkfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
index 5eb3392..9a63863 100644
--- a/lib/tst_mkfs.c
+++ b/lib/tst_mkfs.c
@@ -45,11 +45,13 @@ void tst_mkfs(void (cleanup_fn)(void), const char *dev,
                /*
                 * The -f option was added to btrfs-progs v3.12
                 */
+               void *old_handler = signal(SIGCHLD, SIG_DFL);   
                if (system("mkfs.btrfs 2>&1 | grep '\\-f ' >/dev/null") == 0) {
                        tst_resm(TINFO, "Appending '-f' flag to mkfs.%s",
                                fs_type);
                        argv[pos++] = "-f";
                }
+               signal(SIGCHLD, old_handler);
        }
 
        if (fs_opts) {
-- 
1.9.3


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to