Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/networking/inetd.c

    r3232 r3621  
    171171
    172172#include "libbb.h"
     173#include "common_bufsiz.h"
    173174
    174175#if ENABLE_FEATURE_INETD_RPC
     
    328329    char line[256];          /* _at least_ 256, see LINE_SIZE */
    329330} FIX_ALIASING;
    330 #define G (*(struct globals*)&bb_common_bufsiz1)
     331#define G (*(struct globals*)bb_common_bufsiz1)
    331332enum { LINE_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line) };
    332 struct BUG_G_too_big {
    333     char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
    334 };
    335333#define rlim_ofile_cur  (G.rlim_ofile_cur )
    336334#define rlim_ofile      (G.rlim_ofile     )
     
    353351#define line            (G.line           )
    354352#define INIT_G() do { \
     353    setup_common_bufsiz(); \
     354    BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
    355355    rlim_ofile_cur = OPEN_MAX; \
    356356    global_queuelen = 128; \
     
    646646
    647647/* gcc generates much more code if this is inlined */
    648 static servtab_t *parse_one_line(void)
     648static NOINLINE servtab_t *parse_one_line(void)
    649649{
    650650    int argc;
     
    676676            free(default_local_hostname);
    677677            default_local_hostname = sep->se_local_hostname;
     678            /*sep->se_local_hostname = NULL; - redundant */
     679            /* (we'll overwrite this field anyway) */
    678680            goto more;
    679681        }
     
    689691        bb_error_msg("parse error on line %u, line is ignored",
    690692                parser->lineno);
    691         free_servtab_strings(sep);
    692693        /* Just "goto more" can make sep to carry over e.g.
    693694         * "rpc"-ness (by having se_rpcver_lo != 0).
    694695         * We will be more paranoid: */
     696        free_servtab_strings(sep);
    695697        free(sep);
    696698        goto new;
     
    726728#endif
    727729        }
    728         if (strncmp(arg, "rpc/", 4) == 0) {
     730        if (is_prefixed_with(arg, "rpc/")) {
    729731#if ENABLE_FEATURE_INETD_RPC
    730732            unsigned n;
     
    816818#endif
    817819    argc = 0;
    818     while ((arg = token[6+argc]) != NULL && argc < MAXARGV)
     820    while (argc < MAXARGV && (arg = token[6+argc]) != NULL)
    819821        sep->se_argv[argc++] = xstrdup(arg);
    820822    /* Some inetd.conf files have no argv's, not even argv[0].
     
    835837    }
    836838
    837 //  bb_info_msg(
    838 //      "ENTRY[%s][%s][%s][%d][%d][%d][%d][%d][%s][%s][%s]",
    839 //      sep->se_local_hostname, sep->se_service, sep->se_proto, sep->se_wait, sep->se_proto_no,
    840 //      sep->se_max, sep->se_count, sep->se_time, sep->se_user, sep->se_group, sep->se_program);
     839    //bb_error_msg(
     840    //  "ENTRY[%s][%s][%s][%d][%d][%d][%d][%d][%s][%s][%s]",
     841    //  sep->se_local_hostname, sep->se_service, sep->se_proto, sep->se_wait, sep->se_proto_no,
     842    //  sep->se_max, sep->se_count, sep->se_time, sep->se_user, sep->se_group, sep->se_program);
    841843
    842844    /* check if the hostname specifier is a comma separated list
     
    16551657    time_t t;
    16561658
    1657     t = time(NULL);
     1659    time(&t);
    16581660    fdprintf(s, "%.24s\r\n", ctime(&t));
    16591661}
Note: See TracChangeset for help on using the changeset viewer.