Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/mailutils/mail.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/mailutils/mail.c
r2725 r3232 58 58 59 59 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] 64 67 65 68 if (!G.helper_pid) { … … 76 79 } 77 80 78 c onst FAST_FUNC char *command(const char *fmt, const char *param)81 char* FAST_FUNC send_mail_command(const char *fmt, const char *param) 79 82 { 80 c onst char *msg = fmt;83 char *msg; 81 84 if (timeout) 82 85 alarm(timeout); 83 if (msg) { 86 msg = (char*)fmt; 87 if (fmt) { 84 88 msg = xasprintf(fmt, param); 89 if (verbose) 90 bb_error_msg("send:'%s'", msg); 85 91 printf("%s\r\n", msg); 86 92 } … … 91 97 // NB: parse_url can modify url[] (despite const), but only if '@' is there 92 98 /* 93 static char FAST_FUNC *parse_url(char *url, char **user, char **pass)99 static char* FAST_FUNC parse_url(char *url, char **user, char **pass) 94 100 { 95 101 // parse [user[:pass]@]host … … 114 120 { 115 121 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 */ 117 123 DST_BUF_SIZE = 4 * ((SRC_BUF_SIZE + 2) / 3), 118 124 }; … … 170 176 G.pass = xstrdup(bb_ask(fd, /* timeout: */ 0, "Password: ")); 171 177 } 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); 174 180 } 175 181 if (!G.user || !*G.user || !G.pass)
Note:
See TracChangeset
for help on using the changeset viewer.