summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-05-28 23:17:51 +0000
committerbrian <brian@FreeBSD.org>1998-05-28 23:17:51 +0000
commite0d8cc391d650e6b69d5d77af50a002041522151 (patch)
treee3cc3229d89e0fd28c03dea90790a87b1f1bcfe6 /usr.sbin/ppp/main.c
parentf320a1dcb71e3195a3a9ab924dd4f60db4c3ac53 (diff)
downloadFreeBSD-src-e0d8cc391d650e6b69d5d77af50a002041522151.zip
FreeBSD-src-e0d8cc391d650e6b69d5d77af50a002041522151.tar.gz
o #define the name "tun" in defs.h against the future possibility
of supporting architectures with different device names. o Close /dev/tunX when destroying the bundle. o Don't forget to close the parent end of the pipe in the child process when exec'ing a program from a chat script. o If we close our controlling terminal, ditch the current session with it, allowing getty(8) (or whatever) to regain control. o After transferring our controlling terminal descriptor to another ppp instance, we now fork a new ppp to continue where we left off, transferring ownership of all uucp locks and the /var/run/tunX.pid file. Meanwhile the parent closes all file descriptors, defaults all signals and does a pause() to wait for a HUP after the transferred descriptor is finally closed. We don't run /bin/cat any more (again!). Suggested by: bde TODO: It seems clocal devices need their pause()d session leader to be given a manual HUP, as closing the last open descriptor doesn't do the job.
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 73945a5..e794a15 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -17,12 +17,12 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.125 1998/05/25 02:22:36 brian Exp $
+ * $Id: main.c,v 1.126 1998/05/27 22:43:31 brian Exp $
*
* TODO:
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
@@ -78,8 +78,6 @@
#endif
#endif
-static char pid_filename[MAXPATHLEN];
-
static void DoLoop(struct bundle *);
static void TerminalStop(int);
static const char *ex_desc(int);
@@ -99,7 +97,6 @@ void
AbortProgram(int excode)
{
server_Close(SignalBundle);
- ID0unlink(pid_filename);
log_Printf(LogPHASE, "PPP Terminated (%s).\n", ex_desc(excode));
bundle_Close(SignalBundle, NULL, 1);
bundle_Destroy(SignalBundle);
@@ -239,7 +236,6 @@ ProcessArgs(int argc, char **argv, int *mode)
int
main(int argc, char **argv)
{
- FILE *lockfile;
char *name, *label;
int nfds, mode;
struct bundle *bundle;
@@ -444,19 +440,6 @@ main(int argc, char **argv)
prompt_Required(prompt);
}
- snprintf(pid_filename, sizeof pid_filename, "%stun%d.pid",
- _PATH_VARRUN, bundle->unit);
- lockfile = ID0fopen(pid_filename, "w");
- if (lockfile != NULL) {
- fprintf(lockfile, "%d\n", (int) getpid());
- fclose(lockfile);
- }
-#ifndef RELEASE_CRUNCH
- else
- log_Printf(LogALERT, "Warning: Can't create %s: %s\n",
- pid_filename, strerror(errno));
-#endif
-
log_Printf(LogPHASE, "PPP Started (%s mode).\n", mode2Nam(mode));
DoLoop(bundle);
AbortProgram(EX_NORMAL);
OpenPOWER on IntegriCloud