diff options
| author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-06-22 10:07:17 +0000 |
|---|---|---|
| committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-06-22 10:07:17 +0000 |
| commit | 2bb3a478822aa4da8d3eae42270b143a968eeed2 (patch) | |
| tree | 6ad08a59a2a1cd6a8c24fd9683c5f8df32f5054c /networking | |
| parent | 0abf6fe928b367494d922b061099d53bf23c20dc (diff) | |
| download | busybox-w32-2bb3a478822aa4da8d3eae42270b143a968eeed2.tar.gz busybox-w32-2bb3a478822aa4da8d3eae42270b143a968eeed2.tar.bz2 busybox-w32-2bb3a478822aa4da8d3eae42270b143a968eeed2.zip | |
Patch from Bastian Blank:
On Sat, Jun 19, 2004 at 10:57:37PM +0200, Bastian Blank wrote:
> The following patch changes klogd to use openlog/syslog themself
> instead of calling syslog_msg which always calls the triple
> openlog/syslog/closelog.
Updated patch: get rid of syslog_msg entirely. Request from Erik Andersen.
Bastian
git-svn-id: svn://busybox.net/trunk/busybox@8913 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
| -rw-r--r-- | networking/telnetd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index efb2988b3..724c7cf75 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $Id: telnetd.c,v 1.11 2004/03/15 08:28:53 andersen Exp $ | 1 | /* $Id: telnetd.c,v 1.12 2004/06/22 10:07:17 andersen Exp $ |
| 2 | * | 2 | * |
| 3 | * Simple telnet server | 3 | * Simple telnet server |
| 4 | * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) | 4 | * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) |
| @@ -269,7 +269,7 @@ make_new_session(int sockfd) | |||
| 269 | pty = getpty(tty_name); | 269 | pty = getpty(tty_name); |
| 270 | 270 | ||
| 271 | if (pty < 0) { | 271 | if (pty < 0) { |
| 272 | syslog_msg(LOG_USER, LOG_ERR, "All network ports in use!"); | 272 | syslog(LOG_ERR, "All network ports in use!"); |
| 273 | return 0; | 273 | return 0; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| @@ -292,7 +292,7 @@ make_new_session(int sockfd) | |||
| 292 | 292 | ||
| 293 | 293 | ||
| 294 | if ((pid = fork()) < 0) { | 294 | if ((pid = fork()) < 0) { |
| 295 | syslog_msg(LOG_USER, LOG_ERR, "Can`t forking"); | 295 | syslog(LOG_ERR, "Can`t forking"); |
| 296 | } | 296 | } |
| 297 | if (pid == 0) { | 297 | if (pid == 0) { |
| 298 | /* In child, open the child's side of the tty. */ | 298 | /* In child, open the child's side of the tty. */ |
| @@ -304,7 +304,7 @@ make_new_session(int sockfd) | |||
| 304 | setsid(); | 304 | setsid(); |
| 305 | 305 | ||
| 306 | if (open(tty_name, O_RDWR /*| O_NOCTTY*/) < 0) { | 306 | if (open(tty_name, O_RDWR /*| O_NOCTTY*/) < 0) { |
| 307 | syslog_msg(LOG_USER, LOG_ERR, "Could not open tty"); | 307 | syslog(LOG_ERR, "Could not open tty"); |
| 308 | exit(1); | 308 | exit(1); |
| 309 | } | 309 | } |
| 310 | dup(0); | 310 | dup(0); |
| @@ -330,7 +330,7 @@ make_new_session(int sockfd) | |||
| 330 | execv(loginpath, (char *const *)argv_init); | 330 | execv(loginpath, (char *const *)argv_init); |
| 331 | 331 | ||
| 332 | /* NOT REACHED */ | 332 | /* NOT REACHED */ |
| 333 | syslog_msg(LOG_USER, LOG_ERR, "execv error"); | 333 | syslog(LOG_ERR, "execv error"); |
| 334 | exit(1); | 334 | exit(1); |
| 335 | } | 335 | } |
| 336 | 336 | ||
| @@ -422,6 +422,8 @@ telnetd_main(int argc, char **argv) | |||
| 422 | 422 | ||
| 423 | argv_init[0] = loginpath; | 423 | argv_init[0] = loginpath; |
| 424 | 424 | ||
| 425 | openlog(bb_applet_name, 0, LOG_USER); | ||
| 426 | |||
| 425 | #ifdef CONFIG_FEATURE_TELNETD_INETD | 427 | #ifdef CONFIG_FEATURE_TELNETD_INETD |
| 426 | maxfd = 1; | 428 | maxfd = 1; |
| 427 | sessions = make_new_session(); | 429 | sessions = make_new_session(); |
