diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-23 15:20:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-23 15:20:40 +0000 |
commit | 9e334c58dae21a26059085c7e0b1363776a8e28a (patch) | |
tree | 25ebdffd17be212d835e1371cd30b801bd380804 /src | |
parent | 6bb81ffa0376ac8dde4f4456795bcaa4cf6ab1c6 (diff) | |
download | gnunet-9e334c58dae21a26059085c7e0b1363776a8e28a.tar.gz gnunet-9e334c58dae21a26059085c7e0b1363776a8e28a.zip |
diag
Diffstat (limited to 'src')
-rw-r--r-- | src/util/scheduler.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 1f77d3a68..8e8fe392c 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -31,6 +31,13 @@ | |||
31 | #include "gnunet_time_lib.h" | 31 | #include "gnunet_time_lib.h" |
32 | #ifdef LINUX | 32 | #ifdef LINUX |
33 | #include "execinfo.h" | 33 | #include "execinfo.h" |
34 | |||
35 | /** | ||
36 | * Use lsof to generate file descriptor reports on select error? | ||
37 | * (turn of for stable releases). | ||
38 | */ | ||
39 | #define USE_LSOF GNUNET_YES | ||
40 | |||
34 | /** | 41 | /** |
35 | * Obtain trace information for all scheduler calls that schedule tasks. | 42 | * Obtain trace information for all scheduler calls that schedule tasks. |
36 | */ | 43 | */ |
@@ -658,6 +665,15 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls) | |||
658 | if (errno == EINTR) | 665 | if (errno == EINTR) |
659 | continue; | 666 | continue; |
660 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "select"); | 667 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "select"); |
668 | #ifndef MINGW | ||
669 | #if USE_LSOF | ||
670 | char lsof[512]; | ||
671 | snprintf (lsof, sizeof (lsof), "lsof -p %d", getpid()); | ||
672 | close (1); | ||
673 | dup2 (2, 1); | ||
674 | system (lsof); | ||
675 | #endif | ||
676 | #endif | ||
661 | abort (); | 677 | abort (); |
662 | break; | 678 | break; |
663 | } | 679 | } |