Fossil SCM
If the "fds" query parameter is provided, then the /test-backoffice-lease webpage shows the open file descriptors.
Commit
918e1ddd8e566541a7786d7280208390ff6bab04aef3b84edb80ff9164b632bf
Parent
af599d6adcd2c43…
1 file changed
+14
+14
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -77,10 +77,11 @@ | ||
| 77 | 77 | #else |
| 78 | 78 | # include <unistd.h> |
| 79 | 79 | # include <sys/types.h> |
| 80 | 80 | # include <signal.h> |
| 81 | 81 | # include <errno.h> |
| 82 | +# include <fcntl.h> | |
| 82 | 83 | # define GETPID getpid |
| 83 | 84 | #endif |
| 84 | 85 | |
| 85 | 86 | /* |
| 86 | 87 | ** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice |
| @@ -489,10 +490,23 @@ | ||
| 489 | 490 | @ <tr><th>tmNext:</th><td>%lld(x.tmNext)</td><td></td><td>\ |
| 490 | 491 | if( x.tmNext>0 ){ |
| 491 | 492 | @ (now%+lld(x.tmNext-tmNow)) \ |
| 492 | 493 | } |
| 493 | 494 | @ </td></tr> |
| 495 | +#ifndef _WIN32 | |
| 496 | + if( P("fds")!=0 ){ | |
| 497 | + int i; | |
| 498 | + @ <tr><th>open fds:</th><td colspan="3"> | |
| 499 | + for(i=0; i<1000; i++){ | |
| 500 | + int rc = fcntl(i, F_GETFL, 0); | |
| 501 | + if( rc<0 ) continue; | |
| 502 | + @ %d(i) \ | |
| 503 | + } | |
| 504 | + @ </td></tr> | |
| 505 | + } | |
| 506 | +#endif | |
| 507 | + | |
| 494 | 508 | @ </table> |
| 495 | 509 | style_footer(); |
| 496 | 510 | } |
| 497 | 511 | |
| 498 | 512 | /* |
| 499 | 513 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -77,10 +77,11 @@ | |
| 77 | #else |
| 78 | # include <unistd.h> |
| 79 | # include <sys/types.h> |
| 80 | # include <signal.h> |
| 81 | # include <errno.h> |
| 82 | # define GETPID getpid |
| 83 | #endif |
| 84 | |
| 85 | /* |
| 86 | ** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice |
| @@ -489,10 +490,23 @@ | |
| 489 | @ <tr><th>tmNext:</th><td>%lld(x.tmNext)</td><td></td><td>\ |
| 490 | if( x.tmNext>0 ){ |
| 491 | @ (now%+lld(x.tmNext-tmNow)) \ |
| 492 | } |
| 493 | @ </td></tr> |
| 494 | @ </table> |
| 495 | style_footer(); |
| 496 | } |
| 497 | |
| 498 | /* |
| 499 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -77,10 +77,11 @@ | |
| 77 | #else |
| 78 | # include <unistd.h> |
| 79 | # include <sys/types.h> |
| 80 | # include <signal.h> |
| 81 | # include <errno.h> |
| 82 | # include <fcntl.h> |
| 83 | # define GETPID getpid |
| 84 | #endif |
| 85 | |
| 86 | /* |
| 87 | ** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice |
| @@ -489,10 +490,23 @@ | |
| 490 | @ <tr><th>tmNext:</th><td>%lld(x.tmNext)</td><td></td><td>\ |
| 491 | if( x.tmNext>0 ){ |
| 492 | @ (now%+lld(x.tmNext-tmNow)) \ |
| 493 | } |
| 494 | @ </td></tr> |
| 495 | #ifndef _WIN32 |
| 496 | if( P("fds")!=0 ){ |
| 497 | int i; |
| 498 | @ <tr><th>open fds:</th><td colspan="3"> |
| 499 | for(i=0; i<1000; i++){ |
| 500 | int rc = fcntl(i, F_GETFL, 0); |
| 501 | if( rc<0 ) continue; |
| 502 | @ %d(i) \ |
| 503 | } |
| 504 | @ </td></tr> |
| 505 | } |
| 506 | #endif |
| 507 | |
| 508 | @ </table> |
| 509 | style_footer(); |
| 510 | } |
| 511 | |
| 512 | /* |
| 513 |