Navigation


Changes in / [987:8d7201a747eb:988:371f899276ed] in freeDiameter


Ignore:
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/dbg_interactive/dbg_interactive.c

    r974 r985  
    3636#include <Python.h>
    3737#include <freeDiameter/extension.h>
     38#include <unistd.h>
    3839
    3940/* wrapper generated by SWIG */
     
    6162        CHECK_FCT_DO(fd_core_waitstartcomplete(), goto end);
    6263       
    63         fd_log_debug("Starting interactive python interpreter [experimental].");
    64         if (!arg) {
    65                 fd_log_debug("Example syntax:");
    66                 fd_log_debug("   >>> print cvar.fd_g_config.cnf_diamid");
    67                 fd_log_debug("   '%s'", fd_g_config->cnf_diamid);
     64        if (arg) {
     65                fd_log_debug("Starting python interpreter with a script file [experimental].");
     66                Py_Main(2, dum);
     67        } else {
     68                if (!isatty(fileno(stdin)) || !isatty(fileno(stdout))) {
     69                        TRACE_ERROR("[dbg_interactive]: this extension requires freeDiameter to be run from a console terminal!");
     70                        goto end;
     71                }
     72                printf("Starting interactive python interpreter [experimental].\n");
     73                printf("Example syntax:\n");
     74                printf("   >>> print cvar.fd_g_config.cnf_diamid\n");
     75                printf("   '%s'\n", fd_g_config->cnf_diamid);
     76                Py_Main(1, dum);
    6877        }
    69         Py_Main(arg ? 2 : 1, dum);
    7078       
    7179end:   
  • libfdproto/log.c

    r980 r986  
    118118    }
    119119    vfprintf(fstr, format, ap);
    120     fprintf(fstr, "\n");
    121120    if (local_use_color)
    122121             fprintf(fstr, "\e[00m");
     122    fprintf(fstr, "\n");
    123123   
    124124    fflush(fstr);
Note: See TracChangeset for help on using the changeset viewer.