Date: Wed, 10 Jan 2001 15:48:12 +0000 From: "W.H.Scholten" <whs@xs4all.nl> To: freebsd-hackers@FreeBSD.ORG Subject: pppd & mkdir diff Message-ID: <3A5C843C.794BDF32@xs4all.nl>
index | next in thread | raw e-mail
[-- Attachment #1 --]
L.S.
Here are two patches I've been using for a while on both 3.3R and 4.1R:
1. a pppd patch which sends the pppd messages to stderr.
This is useful for dialup connections under X (I use a script to startup
pppd, when the script is killed, so is pppd). Now the pppd startup
messages are sent to e.g. the xterm the script is started on (using
syslog.conf I can get this too but then all xterms get the messages
which is annoying; or is there a way to do this that I'm not aware of?).
Perhaps it's useful as a compile option or a runtime option.
2. a mkdir patch changing an error message.
If for example /tmp/aa does not exist then mkdir /tmp/aa/bb will report
/tmp/aa/bb: No such file or directory
This is true but not the point. The patch makes it say:
/tmp/aa: No such file or directory
Wouter
[-- Attachment #2 --]
--- /usr/src/usr.sbin/pppd/main.c~ Sun Aug 29 17:47:05 1999
+++ /usr/src/usr.sbin/pppd/main.c Mon Jun 12 21:09:47 2000
@@ -191,7 +191,7 @@
#ifdef ULTRIX
openlog("pppd", LOG_PID);
#else
- openlog("pppd", LOG_PID | LOG_NDELAY, LOG_PPP);
+ openlog("pppd", LOG_PID | LOG_NDELAY | LOG_PERROR, LOG_PPP);
setlogmask(LOG_UPTO(LOG_INFO));
#endif
[-- Attachment #3 --]
diff -ruN mkdir.orig/mkdir.c mkdir/mkdir.c
--- mkdir.orig/mkdir.c Sat Sep 4 05:19:38 1999
+++ mkdir/mkdir.c Fri Jan 5 07:56:35 2001
@@ -58,6 +58,8 @@
int build __P((char *, mode_t));
void usage __P((void));
+char *path_prefix __P((char *));
+
int vflag;
@@ -108,7 +110,10 @@
if (build(*argv, omode))
success = 0;
} else if (mkdir(*argv, omode) < 0) {
- warn("%s", *argv);
+ if (errno == ENOTDIR || errno == ENOENT)
+ warn("%s", path_prefix(*argv));
+ else
+ warn("%s", *argv);
success = 0;
} else if (vflag)
(void)printf("%s\n", *argv);
@@ -129,6 +134,19 @@
}
exit(exitval);
}
+
+
+char *path_prefix(char *path) {
+ char *slash;
+
+ if (path[ strlen(path)-1 ] == '/') path[ strlen(path)-1 ] = 0;
+
+ slash = strrchr(path, '/');
+ if (slash) *slash = 0;
+
+ return path;
+}
+
int
build(path, omode)
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A5C843C.794BDF32>
