From 09daa5dfe6979894fe7e4962357b4260827f3cca Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Fri, 20 Dec 2013 09:30:21 -0800 Subject: [PATCH] ovs-check-dead-ifs: Flush buffer before calling execvp. According to Python documentation here for execvp: http://docs.python.org/2/library/os.html "The current process is replaced immediately. Open file objects and descriptors are not flushed, so if there may be data buffered on these open files, you should flush them using sys.stdout.flush() or os.fsync() before calling an exec* function. Without the flush, we will miss the print statements before that if we redirect the o/p to a file. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- utilities/ovs-check-dead-ifs.in | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/ovs-check-dead-ifs.in b/utilities/ovs-check-dead-ifs.in index 9b806ed31..ac54f6c9c 100755 --- a/utilities/ovs-check-dead-ifs.in +++ b/utilities/ovs-check-dead-ifs.in @@ -98,4 +98,5 @@ if bad_pids: print """ The following processes are listening for packets to arrive on network devices that no longer exist. You may want to restart them.""" + sys.stdout.flush() os.execvp("ps", ["ps"] + ["%s" % pid for pid in bad_pids]) -- 2.20.1