Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/mailutils/mail.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/mailutils/mail.c

    r2725 r3232  
    5858
    5959    i = (!G.helper_pid) * 2; // for parent:0, for child:2
    60     close(pipes[i + 1]); // 1 or 3 - closing one write end
    61     close(pipes[2 - i]); // 2 or 0 - closing one read end
    62     xmove_fd(pipes[i], STDIN_FILENO); // 0 or 2 - using other read end
    63     xmove_fd(pipes[3 - i], STDOUT_FILENO); // 3 or 1 - other write end
     60    close(pipes[i + 1]);     // 1 or 3 - closing one write end
     61    close(pipes[2 - i]);     // 2 or 0 - closing one read end
     62    xmove_fd(pipes[i], STDIN_FILENO);      // 0 or 2 - using other read end
     63    xmove_fd(pipes[3 - i], STDOUT_FILENO); // 3 or 1 - using other write end
     64    // End result:
     65    // parent stdout [3] -> child stdin [2]
     66    // child stdout [1] -> parent stdin [0]
    6467
    6568    if (!G.helper_pid) {
     
    7679}
    7780
    78 const FAST_FUNC char *command(const char *fmt, const char *param)
     81char* FAST_FUNC send_mail_command(const char *fmt, const char *param)
    7982{
    80     const char *msg = fmt;
     83    char *msg;
    8184    if (timeout)
    8285        alarm(timeout);
    83     if (msg) {
     86    msg = (char*)fmt;
     87    if (fmt) {
    8488        msg = xasprintf(fmt, param);
     89        if (verbose)
     90            bb_error_msg("send:'%s'", msg);
    8591        printf("%s\r\n", msg);
    8692    }
     
    9197// NB: parse_url can modify url[] (despite const), but only if '@' is there
    9298/*
    93 static char FAST_FUNC *parse_url(char *url, char **user, char **pass)
     99static char* FAST_FUNC parse_url(char *url, char **user, char **pass)
    94100{
    95101    // parse [user[:pass]@]host
     
    114120{
    115121    enum {
    116         SRC_BUF_SIZE = 45,  /* This *MUST* be a multiple of 3 */
     122        SRC_BUF_SIZE = 57,  /* This *MUST* be a multiple of 3 */
    117123        DST_BUF_SIZE = 4 * ((SRC_BUF_SIZE + 2) / 3),
    118124    };
     
    170176        G.pass = xstrdup(bb_ask(fd, /* timeout: */ 0, "Password: "));
    171177    } else {
    172         G.user = xmalloc_reads(fd, /* pfx: */ NULL, /* maxsize: */ NULL);
    173         G.pass = xmalloc_reads(fd, /* pfx: */ NULL, /* maxsize: */ NULL);
     178        G.user = xmalloc_reads(fd, /* maxsize: */ NULL);
     179        G.pass = xmalloc_reads(fd, /* maxsize: */ NULL);
    174180    }
    175181    if (!G.user || !*G.user || !G.pass)
Note: See TracChangeset for help on using the changeset viewer.