From: Igor Oblakov Date: Fri, 10 Aug 2018 07:08:31 +0000 (+0300) Subject: profctl hang fix X-Git-Tag: submit/tizen/20180911.125435~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87ed3d3591f5b47a9259158600b23cdac4c71ec0;p=sdk%2Ftools%2Fprofctl.git profctl hang fix --- diff --git a/profctl.c b/profctl.c index 2c9d6c3..3df795b 100644 --- a/profctl.c +++ b/profctl.c @@ -57,6 +57,7 @@ static struct option long_options[] = { {0, 0, 0, 0} }; +static void openFileProcess(); static FILE *tf; static void *output_thread(void *arg) @@ -64,6 +65,8 @@ static void *output_thread(void *arg) size_t lsize = 0; char *buffer = NULL; + openFileProcess(); + while (getline(&buffer, &lsize, tf) != -1) { puts(buffer); } @@ -531,7 +534,6 @@ int main(int argc, char **argv) atexit(finish); if (pname) { - openFileProcess(); SimpleThread(&output_thread); }